I'm still learning, but I assume this would be more expensive since we're creating a copy of the array using the spread syntax, right? Using the every method, would be O(n) at worst. While if we use this spread syntax itself would already be O(n) on top of another O(n) from the Math.max
sewY
Wait what? That was it?
I'm still learning, but I assume this would be more expensive since we're creating a copy of the array using the spread syntax, right? Using the every method, would be O(n) at worst. While if we use this spread syntax itself would already be O(n) on top of another O(n) from the Math.max
Isn't this less readable and cost more or am I wrong? Asking because I am genuinely curious and still learning.
Same. I learned something new :)