Closed Frimaire closed 1 year ago
It would be better [...]
Why? This would prevent the proposal from addressing key use cases entirely and it’s unclear to me what advantage it would be providing for others.
prevent scope pollution because the variable can no longer be called in the ordinary style(this === undefined)
for instance, in jQuery, the functions which need this binding are majorly Object.prototype.hasOwnProperty, Array.prototype.slice and Array.prototype.push
Well, I agree that the advantage is negligible.
Object.hasOwn exists now for the first one, and push is generally avoided as a form of mutation, and there’s a proposal already for slice syntax.
Hi,
It would be better if the function which can be call by this operator is required to be declared in a specified way.
Example:
Also, @ operator from deprecated E4X, may be a alternative choice: