js left string code example
Example 1: substring javascript
var str = "Hello world!";
var res = str.substring(1, 4); //ell
Example 2: substring
const str = 'Mozilla';
console.log(str.substring(1, 3));
// expected output: "oz"
console.log(str.substring(2));
// expected output: "zilla"
Example 3: javascript select letter in string
const str = 'Hello';
str.substring(0, 2); // => 'Hel'