What is the output?
const word: string = 'stack'; console.log(word.slice(1, 3));
- ta
- tac
- st
- sta
slice keeps the start index and stops before the end index: characters 1 and 2.
Play Problem Solving ▸
const word: string = 'stack'; console.log(word.slice(1, 3));