Skip to content

Instantly share code, notes, and snippets.

@kowsheek
Created February 20, 2018 20:07
Show Gist options
  • Save kowsheek/28ff5fd99f09fa31af57130b3d8862ea to your computer and use it in GitHub Desktop.
Save kowsheek/28ff5fd99f09fa31af57130b3d8862ea to your computer and use it in GitHub Desktop.
W2D2 breakout

Recap

  • Javascript
  • var
  • functions
  • string concat
  • ES5, transpiling, polyfilling
  • Visualizer

ES6

ES6 features

  • "use strict"
  • let, const, var
    • let
        for(let i = 0; i < 10; i += 1) {
            // i is only available within this scope
        }
    
        if(true) {
            let i = 0;
            // i is only available within this scope
        }
    
        let i = 0;
        {
            let i = 10;
            // i is 10 inside this block statement
        }
    
    • const
        const somethingImportant = {
            workingProperty: 'valueX'
        }
    
        somethingImportant = 'valueY'; // will throw an error
    
        somethingImportant.workingProperty = 'valueY';
    
  • string interpolation
    • back ticks
    • ${}
        let url = `https://myapi.com/${parameter}?q=${queryString} 
    
  • arrow functions
    • inherits this and doesn't create its own
        function(x, y) {}
    
        (x, y) => {}
    
    
  • for...in
  • for...of
  • and more...
    • Class Syntax
    • Promises
    • Modules
    • and even more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment