-
What is ES6
-
Let & Const
- uses block scoping
- const cannot be reassigned
- not hoisted
-
Arrow Functions
- uses block scoping
- implied this value assignment
- no prototype
- The real purpose of arrow functions is to handle the THIS keyword withing nested / callback functions
- You cannot bind new objects to arrow functions (call, apply, bind)
- not hoisted
-
Default Function Parameters
- we can specify default values for parameters
- must go last in param list
- each param can reference the param before it
-
Rest and Spread
- Rest groups passed args into array
- Rest default is array
- Rest Arg lenth will still show total args values passed
- Spread is the oposite of Rest
- Spread take an collection of values and spreads them out as individual arg values
-
Object Literal Extension
- propety and method shorthand (left hand right hand code)
- implied rule use for setting this value in methods. Like arrow functions
-
Template Literals
- better string building with variables
-
Destructoring
- requires iterator
- makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
-
Classes
- Classes still use constructors
- Classes still use prototype
- Just a wrapper over es5 protypal inheritance
- not hoisted
- build protype chain using
extends
keyword super
is use to call parent classconstructor
- can set properties in
constructor
- can set instance methods in body
- can set static members in body (accessed directly from class not instance)
-
Where to go from here
-
Repl Notes
-
-
Save challey17/0583861ea422b0a7c0c857a10b6104ac to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment