Standard built-in objects: String Flashcards

1
Q

What does String.prototype.slice() do?

A

slice(start, end): Extracts part of a string from start index up to, but not including, the end index. Negative indices count from the end.

Example: "Hello".slice(1, 4) // 'ell'

How well did you know this?
1
Not at all
2
3
4
5
Perfectly