Wpis z mikrobloga

Coś z ES6.

var target = function () { return 'I am the target'; };


var handler = {


call: function (receiver, ...args) {


return 'I am the proxy';


}


};


var p = new Proxy(target, handler);


p() === 'I am the proxy'; // true

`

Wow.

#javascript #es6
  • 2
  • Odpowiedz