Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js arrow function vs function

// currently common pattern
var that = this;
getData(function(data) {
  that.data = data;
});

// better alternative with arrow functions
getData(data => {
  this.data = data;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #arrow #function #function
ADD COMMENT
Topic
Name
7+3 =