$ ./guess_the_language
Problem Solving — predict the output
Problem Solving — predict the output · medium · #207
What is the output?
console.log([1, 2, 3].indexOf('2'));
1
2
undefined
-1
indexOf uses strict equality, so the string '2' never matches the number 2.
Play Problem Solving ▸
◂ #206
all Problem Solving — predict the output questions
#208 ▸