Skip to content

Instantly share code, notes, and snippets.

@acareaga
Forked from rrgayhart/es6.markdown
Last active February 1, 2016 22:20
Show Gist options
  • Save acareaga/e29eeaa32b4bde4ce75b to your computer and use it in GitHub Desktop.
Save acareaga/e29eeaa32b4bde4ce75b to your computer and use it in GitHub Desktop.
Aaron Careaga - ES6 Homework

ES5 vs. ES6

What is ES6?

  • ES6 is the latest version of the ECMAScript standard. This standard is a scripting-language specification that JavaScript (Chrome, etc.), JScript (IE) and ActionScript (Adobe) adhere to for client side development. The first edition of standards was released in 1997 and the last major update prior to ES6 was in 2009.

What is Transpilation and how does it relate to ES6?

  • Transpilaton is the process of taking code from one language or standard and transforming it into another similar language or standard. This relates because ES6 is not yet fully supported, so the client side javascript must be transpiled into ES5 via Babel or Traceur.

Looking at the ES6 Features link below, discuss one update from ES5 and if it seems useful/superfluous.

  • An interesting update in ES6 is the let and const features. let is the new var and is used to declare a block scope local variable, where const is used in single assignment. The variable must be assigned (via let) prior to using it as a const. This feature seems useful when containing variable scope is necessary inside a function or variable. The addition was influenced by Firefox.

Example:

function foo(){ for(let i = 0; i< 10; i++){ // i is visible } // i is not visible }

@rrgayhart
Copy link

👍

FYI when you have a codeblock in markdown you can wrap it in three backticks followed by the language above the code ````js`, and three backticks below:

Hard to show in markdown without markdown automatically converting it.. but this is what it'll look like

  function foo () {
    for(let i = 0; i< 10; i++) { 
      // i is visible
    } 
    // i is not visible 
  }

@rrgayhart
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment