js Flashcards
Closures
an inner function that has access to the outer (enclosing) function’s variables—scope chain
Constructor
special method for creating and initializing an object created within a class
Destructuring Object
JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.
var instructor = { firstName: "Elie", lastName: "Schoppik" }
var {firstName:first, lastName:last} = instructor
first; // “Elie”
last
Expressions
Produces value
Declaration(statement)
Performs an action
Inheritence
https://hackernoon.com/inheritance-in-javascript-21d2b82ffa6f
Side Effects
any interaction with the outside world from within a function. NO SIDE EFFECTS function priceAfterTax(productPrice) { return (productPrice * 0.20) + productPrice; } SIDE EFFECTS var tax = 20; function calculateTax(productPrice) { return (productPrice * (tax/100)) + productPrice; }
Rest Operator
used to get the arguments list passed to function on invocation and in array destructur
Spread Operator
fills the function invocation arguments with values from an array
Strict Mode
Deleting a variable, a function, or an argument will result in an error
No More Auto Global Variable Declaration.
Classes
creates an object that is linked to a prototype. Changes to that prototype propagate to the new object, even after instantiation.
Super
The super keyword is used to access and call functions on an object’s parent.
‘new’
creates an instance of a user-defined object type or of one of the built-in object types that has a constructor function
Recursiomn
the ability to call a function from within itself.
Primitives
Boolean Null Undefined Number String Symbol (new in ECMAScript 6)