Ad
  • Custom User Avatar

    The easiest is probably to use JSON.stringify as says B1ts. You can also try with Array.prototype.every()..., but with a 2d array (or more) it's not comfortable.

  • Custom User Avatar

    You should look it up on some search engine :P One way is to use JSON.stringify() to convert an array/object to string representation, and strings you can compare with ===

  • Custom User Avatar

    What's the correct way to check for this case then?

  • Custom User Avatar

    Not a kata issue anyway.

  • Custom User Avatar

    Because you can't compare arrays like that in JS, the references are different in this case.

    Not a kata issue.

  • Custom User Avatar

    Can't even get started here because an if statement for array === [ [] ] never fires... anyone know why this is?

    I'm passing in exactly what console.log spits out and it never runs the block.