You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally you would define the array of numbers in a separate constant even with a flipped order of the arguments.
That's why I think this change would not really bring any benefits.
Many functions in the javascript prototype were designed with the incorrect order of arguments. For instance, in Array#reduce, the array is taken as the final argument even though it is the first thing you need to know to understand the function. Ideally, it is best for the first argument in closestNumber to be the actual number since that is the first thing needed to understand the expression.
It's best if the arguments were the other way around to avoid readability issues with long arrays:
// @andreruffert
The text was updated successfully, but these errors were encountered: