{"id":4110,"date":"2018-04-05T07:43:22","date_gmt":"2018-04-05T05:43:22","guid":{"rendered":"https:\/\/mastercaweb.u-strasbg.fr\/?p=4110"},"modified":"2018-04-05T07:43:22","modified_gmt":"2018-04-05T05:43:22","slug":"javascript-es6-features","status":"publish","type":"post","link":"https:\/\/mastercaweb.unistra.fr\/en\/actualites\/un-categorized\/javascript-es6-features\/","title":{"rendered":"JavaScript ES6: Cool Features You Need to Know"},"content":{"rendered":"<h2>Why you should care about ES6?<\/h2>\n<p><strong>JavaScript ES6<\/strong> came out in 2015. However, most developers still used <strong>ES5 syntax<\/strong> because of compatibility issue with older browsers at that time. Developers can also <b>transpile JavaScript ES6 code into ES5<\/b>.<br \/>\nGiven that more and more users are relying on modern browsers and many front-end frameworks such as React and Vue.js are adopting ES6 syntax, <b>you should start writing ES6 code too<\/b>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-12318 size-large\" src=\"https:\/\/mastercaweb.u-strasbg.fr\/wp-content\/uploads\/2018\/04\/zendevs-es6-javascript-1200x900-1-1-1024x768.png\" alt=\"es6 javascript\" width=\"640\" height=\"480\"><\/p>\n<h2>Cool features to check out<\/h2>\n<p>JavaScript ES6 introduces many <strong>new features.<\/strong>&nbsp;Here are several <b>features that you should really have a look at<\/b>.<\/p>\n<h3>1. `let` and `const`<\/h3>\n<p>In ES5, you use `var` keyword to <b>declare a variable<\/b>. However, it can cause some unexpected issues.<br \/>\nTake a look at the following example:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nvar i;\ni = 34;\nfor (var i = 0; i &lt; 4; i++) {\n  console.log(i);\n}\nconsole.log(i);\n```\n<\/pre>\n<\/div>\n<p>For the last `console.log(i)`, you would expect the console to return 34. However, it returns 4 because of scoping.<br \/>\n<b>To handle the scoping issue<\/b>, ES6 introduced two new keywords for declaring variables: `let` and `const`.<\/p>\n<p>Now take a look at the following example again:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nvar i;\ni = 34;\nfor (let i = 0; i &lt; 4; i++) {\n  console.log(i);\n}\nconsole.log(i);\n```\n<\/pre>\n<\/div>\n<p>The last `console.log(i)` will return 34 because `let` is scoped to the nearest code block.<br \/>\nFor `const`, once a value is assigned to a constant, it becomes immutable.<br \/>\nFor example:<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nconst number = 1;\nnumber = 100; \/\/ Uncaught TypeError: Assignment to constant variable.\n```\n<\/pre>\n<\/div>\n<p>However, for an object, it&#8217;s a bit different.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nconst dog = {\n  name: 'Milo',\n  age: 3\n};\ndog.age = 5; \/\/ Returns 5 if we console.log(dog.age)\ndog = { name: 'Sally' }; \/\/ Uncaught TypeError: Assignment to constant variable.\n```\n<\/pre>\n<\/div>\n<p>The values of object properties are mutable, but constant objects are immutable.<\/p>\n<h3>2. Arrow function<\/h3>\n<p>One of the syntactic treats introduced by JavaScript ES6 is the <b>arrow function<\/b>.<br \/>\nThe arrow function <b>keeps your code shorter<\/b>.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nlet numbers = [1, 2, 3, 4, 5];\n\/\/ ES5 syntax\nvar sum = 0;\nnumbers.forEach(function (number) {\n  sum += number;\n});\nconsole.log(sum);\n\/\/ ES6 syntax\nlet sum = 0;\nnumbers.forEach(number =&gt; { \/\/ parentheses can be omitted if only one parameter is passed to the function\n  sum += number;\n});\n```\n<\/pre>\n<\/div>\n<p>Another benefit is no binding of `this`. The context of `this` won&#8217;t be lost inside the arrow function.<\/p>\n<h3>3. Default Parameter Values<\/h3>\n<p>In ES6, you can <b>assign default parameter values for a function<\/b>.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\n\/\/ ES6 syntax\nfunction add(x = 10, y = 20) {\n  return x + y;\n}\nadd();\n\/\/ ES5 syntax\nfunction add(x, y) {\n  if (x === undefined) {\n    x = 10;\n  }\n  if (y === undefined) {\n    y = 20;\n  }\n  return x + y;\n}\nadd();\n```\n<\/pre>\n<\/div>\n<h3>4. String interpolation<\/h3>\n<p>In ES6, you can do <b>string interpolation<\/b>, just like you would do in other programming languages such as PHP.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\n\/\/ ES6 syntax\nlet customer = { name: 'Calvin', amount: '$500' };\nlet message = `${customer.name} just spent ${customer.amount} on a product.`;\n\/\/ ES5 syntax\nvar customer = { name: 'Calvin', amount: '$500' };\nvar message = customer.name + ' just spent ' + customer.amount + ' on a product.'\n```\n<\/pre>\n<\/div>\n<h3>5. Destructuring<\/h3>\n<p>If you look at the previous example, you can see I have to repeat `customer` several times. Imagine that we have something longer, like `customer.address.street`. We would have to write that long variable over and over again if we need that value stored in that variable. What a nightmare! So, let&#8217;s take the example and do some <b>refactoring<\/b> in ES6.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\nlet customer = { name: 'Calvin', amount: '$500' };\nlet { name, amount } = customer;\nlet message = `${name} just spent ${amount} on a product.`;\n```\n<\/pre>\n<\/div>\n<h3>6. Classes<\/h3>\n<p>In ES5, JavaScript doesn&#8217;t support &#8220;classes&#8221;, it just simulates this functionality through &#8220;prototypes&#8221;. The syntax is very confusing and hard to read. With ES6, <b>&#8220;classes&#8221; have been introduced<\/b>, which makes writing object-oriented code more readable and organized.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\n\/\/ ES6 syntax\nclass Person {\n  constructor(name, age) {\n    this.name = name;\n    this.age = age;\n  }\n  speak() {\n    console.log(`Hi, I'm ${this.name} and I'm ${this.age} years old`);\n  }\n}\n\/\/ ES5 syntax\nfunction Person(name, age) {\n  this.name = name;\n  this.age = age;\n}\nPerson.prototype.speak = function() {\n  console.log('Hi, I\\'m ' + this.name + ' and I\\'m ' + this.age + ' years old');\n}\n```\n<\/pre>\n<\/div>\n<h3>7. New Built-In Methods<\/h3>\n<p>With ES6, it&#8217;s <b>much easier to find an element in an array<\/b>.<br \/>\nFor example, let say we&#8217;ve fetched a JSON response from an API server <a href=\"https:\/\/jsonplaceholder.typicode.com\">JSONPlaceholder<\/a>.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```json\n[\n  {\n    \"userId\": 1,\n    \"id\": 1,\n    \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",\n    \"body\": \"quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 2,\n    \"title\": \"qui est esse\",\n    \"body\": \"est rerum tempore vitae\\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\\nqui aperiam non debitis possimus qui neque nisi nulla\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 3,\n    \"title\": \"ea molestias quasi exercitationem repellat qui ipsa sit aut\",\n    \"body\": \"et iusto sed quo iure\\nvoluptatem occaecati omnis eligendi aut ad\\nvoluptatem doloribus vel accusantium quis pariatur\\nmolestiae porro eius odio et labore et velit aut\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 4,\n    \"title\": \"eum et est occaecati\",\n    \"body\": \"ullam et saepe reiciendis voluptatem adipisci\\nsit amet autem assumenda provident rerum culpa\\nquis hic commodi nesciunt rem tenetur doloremque ipsam iure\\nquis sunt voluptatem rerum illo velit\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 5,\n    \"title\": \"nesciunt quas odio\",\n    \"body\": \"repudiandae veniam quaerat sunt sed\\nalias aut fugiat sit autem sed est\\nvoluptatem omnis possimus esse voluptatibus quis\\nest aut tenetur dolor neque\"\n  }\n]\n```\n<\/pre>\n<\/div>\n<p>We need to display the post with `&#8221;id&#8221;: 5`. In this case, the `find` function may come in handy.<\/p>\n<div style=\"background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em; margin-top: 15px;\">\n<pre style=\"margin: 0; line-height: 125%;\">```javascript\n\/\/ First we parse JSON into JavaScript object\nlet posts = [\n  {\n    \"userId\": 1,\n    \"id\": 1,\n    \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",\n    \"body\": \"quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 2,\n    \"title\": \"qui est esse\",\n    \"body\": \"est rerum tempore vitae\\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\\nqui aperiam non debitis possimus qui neque nisi nulla\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 3,\n    \"title\": \"ea molestias quasi exercitationem repellat qui ipsa sit aut\",\n    \"body\": \"et iusto sed quo iure\\nvoluptatem occaecati omnis eligendi aut ad\\nvoluptatem doloribus vel accusantium quis pariatur\\nmolestiae porro eius odio et labore et velit aut\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 4,\n    \"title\": \"eum et est occaecati\",\n    \"body\": \"ullam et saepe reiciendis voluptatem adipisci\\nsit amet autem assumenda provident rerum culpa\\nquis hic commodi nesciunt rem tenetur doloremque ipsam iure\\nquis sunt voluptatem rerum illo velit\"\n  },\n  {\n    \"userId\": 1,\n    \"id\": 5,\n    \"title\": \"nesciunt quas odio\",\n    \"body\": \"repudiandae veniam quaerat sunt sed\\nalias aut fugiat sit autem sed est\\nvoluptatem omnis possimus esse voluptatibus quis\\nest aut tenetur dolor neque\"\n  }\n];\n\/\/ We find the post with id 5\nlet targetPost = posts.find(post =&gt; post.id === 5);\n\/\/ We display the post on console\nconsole.log(targetPost);\n```\n<\/pre>\n<\/div>\n<h2>Conclusion<\/h2>\n<p>There are many cool new features introduced in ES6. This would be a lengthy article if I were to cover all the features. If you want to know more about ES6, visit <a href=\"http:\/\/es6-features.org\/\">ECMAScript 6: New Features: Overview &amp; Comparison<\/a>.<\/p>\n<p><a href=\"https:\/\/www.linkedin.com\/in\/siukeicheung\/\">Written by&nbsp;Siu Kei CHEUNG<\/a><!--\/codes_iframe--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why you should care about ES6? JavaScript ES6 came out in 2015. However, most developers still used ES5 syntax because [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4111,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-4110","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript ES6: overview of the coolest new features - Master CAWEB<\/title>\n<meta name=\"description\" content=\"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript ES6: overview of the coolest new features - Master CAWEB\" \/>\n<meta property=\"og:description\" content=\"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/\" \/>\n<meta property=\"og:site_name\" content=\"Master CAWEB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/master.caweb\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-05T05:43:22+00:00\" \/>\n<meta name=\"author\" content=\"cawebinte1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mastercaweb\" \/>\n<meta name=\"twitter:site\" content=\"@mastercaweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cawebinte1\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/\"},\"author\":{\"name\":\"cawebinte1\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/person\\\/431b92909694c397fc8112e99e2ef4aa\"},\"headline\":\"JavaScript ES6: Cool Features You Need to Know\",\"datePublished\":\"2018-04-05T05:43:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/\"},\"wordCount\":497,\"publisher\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/\",\"name\":\"JavaScript ES6: overview of the coolest new features - Master CAWEB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#primaryimage\"},\"thumbnailUrl\":\"\",\"datePublished\":\"2018-04-05T05:43:22+00:00\",\"description\":\"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#primaryimage\",\"url\":\"\",\"contentUrl\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/actualites\\\/web\\\/javascript-es6-features\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript ES6: Cool Features You Need to Know\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#website\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/\",\"name\":\"Master CAWEB\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#organization\",\"name\":\"Master CAWEB\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-caweb.webp\",\"contentUrl\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/wp-content\\\/uploads\\\/2024\\\/03\\\/logo-caweb.webp\",\"width\":351,\"height\":100,\"caption\":\"Master CAWEB\"},\"image\":{\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/master.caweb\",\"https:\\\/\\\/x.com\\\/mastercaweb\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/#\\\/schema\\\/person\\\/431b92909694c397fc8112e99e2ef4aa\",\"name\":\"cawebinte1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g\",\"caption\":\"cawebinte1\"},\"sameAs\":[\"https:\\\/\\\/mastercaweb.unistra.fr\"],\"url\":\"https:\\\/\\\/mastercaweb.unistra.fr\\\/en\\\/actualites\\\/author\\\/cawebinte1\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript ES6: overview of the coolest new features - Master CAWEB","description":"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript ES6: overview of the coolest new features - Master CAWEB","og_description":"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.","og_url":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/","og_site_name":"Master CAWEB","article_publisher":"https:\/\/www.facebook.com\/master.caweb","article_published_time":"2018-04-05T05:43:22+00:00","author":"cawebinte1","twitter_card":"summary_large_image","twitter_creator":"@mastercaweb","twitter_site":"@mastercaweb","twitter_misc":{"Written by":"cawebinte1","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#article","isPartOf":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/"},"author":{"name":"cawebinte1","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/person\/431b92909694c397fc8112e99e2ef4aa"},"headline":"JavaScript ES6: Cool Features You Need to Know","datePublished":"2018-04-05T05:43:22+00:00","mainEntityOfPage":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/"},"wordCount":497,"publisher":{"@id":"https:\/\/mastercaweb.unistra.fr\/#organization"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#primaryimage"},"thumbnailUrl":"","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/","url":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/","name":"JavaScript ES6: overview of the coolest new features - Master CAWEB","isPartOf":{"@id":"https:\/\/mastercaweb.unistra.fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#primaryimage"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#primaryimage"},"thumbnailUrl":"","datePublished":"2018-04-05T05:43:22+00:00","description":"JavaScript ES6 came out in 2015. But new features were released!\u00a0Here are some of them, and you should really have a look at those.","breadcrumb":{"@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/mastercaweb.unistra.fr\/actualites\/web\/javascript-es6-features\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/mastercaweb.unistra.fr\/en\/"},{"@type":"ListItem","position":2,"name":"JavaScript ES6: Cool Features You Need to Know"}]},{"@type":"WebSite","@id":"https:\/\/mastercaweb.unistra.fr\/#website","url":"https:\/\/mastercaweb.unistra.fr\/","name":"Master CAWEB","description":"","publisher":{"@id":"https:\/\/mastercaweb.unistra.fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mastercaweb.unistra.fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mastercaweb.unistra.fr\/#organization","name":"Master CAWEB","url":"https:\/\/mastercaweb.unistra.fr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/logo\/image\/","url":"https:\/\/mastercaweb.unistra.fr\/wp-content\/uploads\/2024\/03\/logo-caweb.webp","contentUrl":"https:\/\/mastercaweb.unistra.fr\/wp-content\/uploads\/2024\/03\/logo-caweb.webp","width":351,"height":100,"caption":"Master CAWEB"},"image":{"@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/master.caweb","https:\/\/x.com\/mastercaweb"]},{"@type":"Person","@id":"https:\/\/mastercaweb.unistra.fr\/#\/schema\/person\/431b92909694c397fc8112e99e2ef4aa","name":"cawebinte1","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e4d7477db19aae8bc90c90565ae900f5ad6cb035ef4337cae03a3962f43935d?s=96&d=mm&r=g","caption":"cawebinte1"},"sameAs":["https:\/\/mastercaweb.unistra.fr"],"url":"https:\/\/mastercaweb.unistra.fr\/en\/actualites\/author\/cawebinte1\/"}]}},"_links":{"self":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts\/4110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/comments?post=4110"}],"version-history":[{"count":0,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/posts\/4110\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/media?parent=4110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/categories?post=4110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mastercaweb.unistra.fr\/en\/wp-json\/wp\/v2\/tags?post=4110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}