Strings In Depth10 / 18
Up next

Slice a substring

const s = "hello world";
console.log(s.slice(0, 5));
// negative offsets count from the end
console.log(s.slice(-5));
What you're solving

slice(start, end), end excluded