DEV Community

Discussion on: Simplest way to compare two numbers array in JS

Collapse
 
hnicolas profile image
Nicolas Hervé

You forgot to compare array sizes.

compare([1], [1, 2]); // true
Enter fullscreen mode Exit fullscreen mode