Presented by
Samundra Khatri
Madhu Sudhan Subedi
ES6 Features - Part1
What is ES6 ?
ECMAScript 6 (ES6) is the latest sixth major release of the ECMAScript
language specification.
ECMAScript is the “proper” name for the language commonly referred to as
JavaScript.
Released at june, 2015.
Some Features of Es6
Blocked Scoped
Variables
Let and const
What is var ?
● `const` is a signal that the identifier won’t be reassigned, Immutable.
● `let`, is a signal that the variable may be reassigned, such as a counter in a
loop, or a value swap in an algorithm.
● `Var` is now the weakest signal available when you define a variable in
javascript.
What’s difference ?
Let’s See one Example Here
Every time gives the result `The number is 10` Why ?
Blocked Scoped
Functions
● Scope of the function is inside
block only.
● From the outside of block
function can not be accessible.
● Function can be defined inside
function or inside { }
● That means IIFE is less necessary
in ES6
Figure: Showing the block scope of function example
Template Literals
● Template literals are enclosed by
the back tick (` `) character
instead of double or single quotes.
● Indicated by the dollar sign and
curly braces . For example:-
Arrow Functions
● Arrow Function expression has a
shorter syntax than a function
expression.
● Provides two special things:-
Shorter functions and No
bindings of this
● Arrow functions expression is shorter syntax than javascript function
expression.
Shorter Functions
● If in function there is no any parameters then handle by arrow function
like this.
● Parenthesis is required if there is no parameter.
No Parameters ?
● Can be used to return an object literal expression.
Object Literal Syntax
● In code with multiple nested functions, it can be difficult to keep track of
and remember to bind the correct this context.
No bindings of this
● Using Es6 We Can use this using arrow function without binding or
reassign this to other variables.
No bindings of this
Learn - Develop - Grow
Thank You :)
References
https://medium.com/javascript-scene/javascript-es6-var-let-or-const-
ba58b8dcde75#.qih8x5hvf
https://i.stack.imgur.com/v45hL.png
https://i.ytimg.com/vi/p1jCfPIBh0M/maxresdefault.jpg
http://learnwebtutorials.com/wp-content/uploads/2015/08/es6-extends-
keyword.jpg
https://www.sitepoint.com/joys-block-scoping-es6/
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_l
iterals
References
https://www.sitepoint.com/es6-arrow-functions-new-fat-concise-syntax-
javascript/

Es6 features part 1