Arrow functions

1
2
// ES5 example
var sayHello = function(name) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions

this in an arrow function is NOT a variable.
this arrow function is lexical.
- What that mean is, when we define an arrow function, this value will be assigned based on where the arrow function was defined, rather than what it will be assigned later when the application was running.
- this in arrow function works more like a constant, rather than a variable.
- The value of a constant was being deci

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.