Compare substring vs slice.
const str = 'Hello World! This is a test string.';
Initializing...
str.substring(6, 11);
str.slice(6, 11);
str.substr(6, 5);
You can edit these tests or add more tests to this page by appending /edit to the URL.