Awesome to finally get to use Webpack and Babel to transpile some ES6 code to vanilla JavaScript that even Internet Explorer can use:
ES6:
1 2 3 4 5 6 7 8 9 10 11 | export function arrowTest() { var materials = [ ‘Hydrogen’, ‘Helium’, ‘Lithium’, ‘Beryllium’ ]; // expected output: Array [8, 6, 7, 9] return materials.map(material => material.length); } |
Transpiled:
1 2 3 4 5 6 7 | function arrowTest() { var materials = [‘Hydrogen’, ‘Helium’, ‘Lithium’, ‘Beryllium’]; // expected output: Array [8, 6, 7, 9] return materials.map(function (material) { return material.length; }); } |
Useful links: