JS6Learn Javascript / By nukeama Here are some basic Javascript 6 which i know. It’s very usefull for coding gutenberg related plugin and react application Scope <script> // var , let , const var a = 10; function echo() { let a = 5; alert("a inside function :" + a); // 5 } echo(); alert("a outside function :" + a); // 10 // let scope is limited in {} </script> View Demo Template Strings <script> // Template literal let name = "John Snow"; let age = 30; let output = `My name is ${name} and age ${age}`; alert(output); let price = 3; let item_count = 10; let data = `${item_count} items and total price $${(price* item_count)}`; alert(data); </script> View Demo Arrow Functions <script> let myadd = (a,b) => { return a + b; } let mymult = (a,b) => { return a * b; } alert("3 + 2 = " + myadd(3,2)); alert("3 * 2 = " + mymult(3,2)); const dataArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; const Mod3 = dataArray.filter(v => v % 3 === 0); alert(Mod3.join(' ').toString()); let theFive = []; dataArray.forEach(v => { if (v % 5 === 0) theFive.push(v); }); alert(theFive.join(' ').toString()); var nums = dataArray.map((v, i) => v + i); alert(nums.join(' ').toString()); </script> View Demo