$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · easy · #59

What is the output?

console.log('abc'.slice(-2));
  1. bc
  2. ab
  3. c
  4. abc
A negative start counts from the end, giving the last two characters.
Play Problem Solving ▸