$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #3

Which fix removes the bug?

const nums = [1, 2, 3];
console.log(nums.length());
  1. Use nums.size without ()
  2. Use nums.count as a method
  3. Use nums.length without ()
  4. Use length(nums) as a call
length is a property, not a method, so drop the parentheses.
Play Problem Solving ▸