>const sum = array.reduce(Math.add);
 
It is better not to do this... because the Array#reduce passed 4 parameters to callback.
 
>array.sort((a, b) => a - b);
 
This comparator will not give you a good result when the platform does not support denormalized numbers, as the difference 2.225073858507202e-308 - 2.2250738585072014e-308 will be zero.
 
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to