-
Arrow functions for Beginners - Codeburst
Arrow functions: Fat and Concise Syntax in Javascript - Sitepoint
- they don't get their own
this
keyword - inside of arrow functions,
this
has its original meaning from enclosing context - the fact that arrow functions don't have their own
this
keyword can be quite helpful- you just need to understand when you might NOT want that - Arrow functions also don't get their own
arguments
keyword - An
arguments
keyword can be accessed if the arrow function is inside anotherfunction
function(outer){ return innerFunction = ()=> {
return arguments;
}
}
outer(1)(2); //Prints only 1
Arrow functions should NEVER be used for creating methods in objects since we will get the incorrect value of
this
. - they don't get their own
-
- Rest operator always returns an array
- Is called the rest operator only when it's a parameter to a function
-
- Used on arrays to spread each value out (as a comma separated value)
- Useful when you have an array, but what you are working with expects comma separated values
- Used on arrays to spread each value out (as a comma separated value)
- Useful when you have an array, but what you are working with expects comma separated values
-
Extracting values from data stored in objects and arrays
Less Used features in ES2015-Proxies