0
Q:

js string slicing

const str = 'The quick brown fox jumps over the lazy dog.';

console.log(str.slice(31));
// expected output: "the lazy dog."

console.log(str.slice(4, 19));
// expected output: "quick brown fox"
5

var str = "Hello world!";

var res = str.slice(0, 5);
 
2

New to Communities?

Join the community