<commit_before>---
layout: post
title: What's new in ECMAScript6 (ES6)?
subtitle: Comparision between ES5 and ES6 features.
---

This post contains the list of new features introduced in ES6. Similarly, we will go through the syntax used in ES5 side by side with ES6.

#### Classes

#### Modules

#### const and let 

#### Arrows functions

#### Default Parameters

```javascript
//ES5 Style
var changeColor = function(color) {
  var marioColor = color || 'red';
  
  this.css({
    background-color: marioColor;
  });
}
//ES6 Style
var changeColor = function(color = 'red') {
  var marioColor = color ;
  
  this.css({
    background-color: marioColor;
  });
}

//Calling function
changeColor();

```<commit_msg>Update 2017-02-06-ES6-new-features.md<commit_after>---
layout: post
title: What's new in ECMAScript6 (ES6)?
subtitle: Comparision between ES5 and ES6 features.
---

This post contains the list of new features introduced in ES6. Similarly, we will go through the syntax used in ES5 side by side with ES6.

#### Classes

#### Modules

#### const and let 

#### Arrows functions

#### Default Parameters

```javascript
//ES5 Style
var changeColor = function(color) {
  var marioColor = color || 'red';
  
  this.css({
    background-color: marioColor;
  });
}
//ES6 Style
var changeColor = function(color = 'red') {
  var marioColor = color ;
  
  this.css({
    background-color: marioColor;
  });
}
//Calling function
changeColor();
```

#### Template Literals

```javascript
//ES5 Style
var fullName = firstname + ' ' + lastname;

//ES6 Style
var fullName = `${firstname} ${lastname}`;
```
{'fraction_non_alphanumeric': 0.13982521847690388, 'fraction_numerical': 0.018102372034956304, 'mean_word_length': 3.6871345029239766, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4424094', 'n_tokens_mistral': 524, 'n_tokens_neox': 507, 'n_words': 174}