String.prototype.slicebeginnerconst str = 'Hello, World!'
str.slice(7, 12) // β 'World'
str.slice(-6, -1) // β 'World'
str.slice(7) // β 'World!'Use slice() to extract a portion of a string by start and end indices, supporting negative indices.
If you omit the second argument, .slice() goes to the end of the string.
Challenge: Implement fromIndex(str, n) that returns everything from index n onwards.
fromIndex('hello world', 6) // β 'world'
fromIndex('abcdef', 3) // β 'def'