Ad
  • Custom User Avatar

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

  • Custom User Avatar
    1. lastIndexOf returns -1 if string doesn't have the substring (there is no 'omo' in 'sumo', hence lastIndexOf returns -1).
    2. In Javascript if the condition gets ANY value that doesn't equal 0 (doesn't matter if it's a negative value like -1), code is still being executed (like in the 'omo' in 'sumo' example).

    I would recommend changing the condition a little bit. Hope it helps!