Ad
  • Custom User Avatar

    it should be for not if, the if should be nested in the for loop, first if should be i === 0 and second should be i === 1

  • Custom User Avatar

    could you perhaps teach me other tips and tricks in js other than

    The way I see it, some use cases:

    Aliasing other functions. For example log = console.log would allow you to get rid of typing console every time.
    Because why not / code golf purposes.
    Some more advanced use cases like String.prototype.map = Array.prototype.map, that would allow you to use map on strings directly.
    It looks cooler.
    

    if you dont mind ofcourse

  • Custom User Avatar

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