[es6] arrow func
arrow function
Syntax
var chewToys = puppies.map(puppy => {}); // BUG!!
var chewToys = puppies.map(puppy => ({})); // OKthis
Last updated
Was this helpful?
var chewToys = puppies.map(puppy => {}); // BUG!!
var chewToys = puppies.map(puppy => ({})); // OKLast updated
Was this helpful?
Was this helpful?
{
...
addAll: function addAll(pieces) {
var self = this;
_.each(pieces, function (piece) {
self.add(piece);
});
}
}{
addAll: function addAll(pieces) {
_.each(pieces, piece => this.add(piece));
},
}{
addAll(pieces) {
_.each(pieces, piece => this.add(piece));
}
}