1. Quick Links
  2. Favorite Javascript Books
  3. ECMAScript 6 (ES 2015)
  4. Basic Language
    1. Prototype
    2. Accessing Object Properties
  5. React
    1. setState

    Quick Links

    • See how ES compiles to javascript: https://babeljs.io/repl/
    • A re-introduction to javascript: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Are-introductionto_JavaScript

    Favorite Javascript Books

    • Functional JavaScript (this one is awesome!)
    • Javascript: The Good Parts

    ECMAScript 6 (ES 2015)


    This version introduces the concept of ES6 modules and the import syntax.


    Basic Language


    All objects created from object literals are linked to Object.prototype.

    Accessing Object Properties

    When you try to access a property that does not exist inside an object, javascript gives undefined.

    // undefined

    If you try to access a property inside undefined, you get a type exception

    // throws "TypeError"

    To guard against this, use &&

    myobject.dne && myobject.dne.reallydne
    // undefined



    Two forms of setState, either just pass an object:

      something: "changed"

    Or pass a function to get access to previous state and props:

    this.setState((prevState, props) => ({
      counter: prevState.counter + props.increment

    setState merges the object passed (or the result from the function passed) into the components state.