Lesson 2 b: Some pre requisite knowledge (Theory) ES 2015 ES6 - udaisshekhawat/ReactNativeTutorial GitHub Wiki

ES5 - ES2009 ES6 - ES2015

Using Babel, gives us access to newer features which aren't yet, ensuring our Javascript runs on even more platforms. React native uses Babel to enable ES2015 and newer features and ensure cross-platform consistency, so your JavaScript can run over Android, IPhone, Windows and other platforms.

ES6/ES20015 Highlights:

  1. Block Scoped Declarations
  2. Fat Arrow functions
  3. Destructuring
  4. Imports and Exports
  5. Default Parameters
  6. Classes
  7. Dynamic Object keys
  8. Array Spread

Details:

  1. Block Scoped Declarations

Use const and let instead of var var is scoped to a function while const and let are scoped to a block if a value is assigned to a const then no other value can be assigned to the same const. Unless the const variable is an object or array. The object or array can still be modified as its only the variable name that is bound permanently.