DEV Community

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

Collapse
 
valeriavg profile image
Valeria

There is no general right or wrong as it depends on a particular use case, but if you want an optimal solution that would handle most of the cases it'll probably be a recursive iterator over indices with early return.