-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed as not planned
Labels
ES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)RevisitAn issue worth coming back toAn issue worth coming back toSuggestionAn idea for TypeScriptAn idea for TypeScriptWaiting for TC39Unactionable until TC39 reaches some conclusionUnactionable until TC39 reaches some conclusion
Description
Edit from @DanielRosenwasser: Since this issue was filed, a separate proposal for ::
was created called "extensions".
https://github.com/tc39/proposal-extensions
It will be great if TypeScript had an implementation of the "::" bind operator of ECMAScript 7. Some examples of this operator and the implementation in ES5:
Bind
// ES5
var log = console.log.bind(console);
// ES7
let log = ::console.log;
Call
// ES5
var forEach = Array.prototype.forEach,
elements = document.querySelectorAll("div");
forEach.call(elements, div => { console.log(div); })
// ES7
let forEach = Array.prototype.forEach,
elements = document.querySelectorAll("div");
elements::forEach(div => { console.log(div) });
[ref] [more examples]
qiu8310, alexanderGugel, mkjeff, Alexendoo, michalstocki and 271 moreigl, menduz, jonrimmer, AlexGalays, mohsen1 and 10 morekgtkrciuncan, sergey-shandar, michaelmesser, agu-z, Mahmoud-Masri and 25 moresergey-shandar, niieani, ladas-larry, asm-jaime, michaelmesser and 41 more
Metadata
Metadata
Assignees
Labels
ES NextNew featurers for ECMAScript (a.k.a. ESNext)New featurers for ECMAScript (a.k.a. ESNext)RevisitAn issue worth coming back toAn issue worth coming back toSuggestionAn idea for TypeScriptAn idea for TypeScriptWaiting for TC39Unactionable until TC39 reaches some conclusionUnactionable until TC39 reaches some conclusion