$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · medium · #152
What is the output?
console.log([1, 2, 3].slice(-1));
[ 3 ]
[ 1 ]
[ 2, 3 ]
[]
A negative start counts from the end, so slice(-1) takes the last element.
Play Problem Solving ▸
◂ #151
all Problem Solving — predict the output questions
#153 ▸