Ad
  • Default User Avatar

    I've started from filter, but the test found it incorrect, and then I tried many methods, including endsWith, for loop, map, when I re-read the task and found out that it was saying to output even numbers, when I was trying to output odd ones. What a waste of time by me

  • Default User Avatar

    false, 0, "", null and undefined all have the property that when used in a if statement that they will equate to false. So it isn't necessary at all.

    As for production code, it is used without the === true. Which is generally done for all if statements. We also don't write code like

    if ((index === 4) === true) {
      // some logic
    }
    
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Too much repeated code I think.