>
> Object.getOwnPropertyNames(Math).forEach((key) => {
> if (typeof Math[key] === 'function') Number.prototype[key]= () =>
> Math[key](this);
> });
>
Hi Jorge,
Here you are defining a method, for which arrows are inappropriate.
Long-hand functions are appropriate in this case.
Object.getOwnPropertyNames(Math).forEach(key => {
if (typeof Math[key] === "function")
Number.prototype[key] = function() { return Math[key](this); };
});
No one's attempting to deprecate long-hand functions. Arrow functions fill
a different need.
kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss