# ECMAScript-2015 & ES-6

ECMAScript 2015 was the newer version of JavaScript that was introduced in 2015.
it is also known as ES6
In These Versions JavaScript Introduced lots of newly and and  most important future like

✅ Let and Const

✅ Template String

✅ Default Argument

✅ Arrow Function

✅ Rest Operator

✅ Spread Operator

✅ Array Destructuring

### 1️⃣ Let And Const

let and const ware introduced in ES6 and both was the block and functional scoped variable. let was the preferred way over using var. which can be reassigned and can’t be redeclared but const can’t be reassigned nor redeclared.
<iframe
  src="https://carbon.now.sh/embed/ElbjGYdx0ikc3eD0UUQ1"
  style="width: 883px; height: 428px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>

### 2️⃣ Template String
Template string allows multiple variable in a string its also known as template literals.
<iframe
  src="https://carbon.now.sh/embed/hcCZ7BPUXT8O4ko98Ocf"
  style="width: 884px; height: 279px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>

### 3️⃣ Default Argument

Default arguments means a value provided in a function declaration that is automatically assigned by the compiler if the called function 
<iframe
  src="https://carbon.now.sh/embed/Hvrjsr9WcziEaz6jOtqI"
  style="width: 884px; height: 428px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>

### 4️⃣ Arrow Function
Arrow function allow us fat arrow => operator to quick define function  with or without arguments. it is also introduced in ES6
<iframe
  src="https://carbon.now.sh/embed/1UOnDiR3nVI89YTeLnAk"
  style="width: 883px; height: 409px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>

 ### 5️⃣ Rest Operator
Rest Operator  ( ... ) allows us to quickly take the rest parameter in a function and converted parameter into array it is also introduced in ES6.
it
<iframe
  src="https://carbon.now.sh/embed/rCxlqFvtZihe0ZflRTrc"
  style="width: 883px; height: 298px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>

 ### 6️⃣ Spread Operator

Spread Operator  ( ... ) allows us to quickly copy all or part of an existing array or object into another array or object. it is also introduced in ES6.
<iframe
  src="https://carbon.now.sh/embed/ZyuXLnJk3VG2iTUgMHTH"
  style="width: 875px; height: 353px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>
### 7️⃣ Array Destructuring

Array destructuring assignment syntax is a JavaScript expression that makes it possible to unpack elements from arrays and objects.
<iframe
  src="https://carbon.now.sh/embed/5Kj5JKUi7zNh14BgKgGw"
  style="width: 934px; height: 577px; border:0; transform: scale(1); overflow:hidden;"
  sandbox="allow-scripts allow-same-origin">
</iframe>



