$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #36

What is the output?

console.log("abc".indexOf("b"));
  1. 0
  2. 2
  3. -1
  4. 1
"b" is at index 1 in zero-based indexing.
Play Problem Solving ▸