This article looks at the new function syntax offered in ECMAScript 6. This includes arrow functions, parameter default values, and the rest parameter ECMAScript 6 is a case sensitive language; it means the lower-case and upper-case letters are different in ECMAScript. The term Case sensitive refers to the continued capitalization of the letter. It means the variables, functions names, and identifiers should always be typed in the continuous capitalization of characters The arrow function is a new feature used in ECMAScript 6. This function helps us to write and work with the functions accurately. The arrow functions also make the source code more structured and readable. Function Hoisting. Syntax function f1 (args1, args2).
ECMAScript 6 reached feature complete status in 2015 and was formally dubbed ECMAScript 2015. (But this text still refers to it as ECMAScript 6, the name most familiar to developers.) The features vary widely from completely new objects and patterns to syntax changes to new methods on existing objects Again, the reason this works is because the value of arr is expanded to fill the brackets of our arr2 array definition. Thus, we are setting arr2 to equal the individual values of arr instead of the reference to arr like we did in the first example.. Bonus Example — String to Array. As a fun final example, you can use the spread syntax to convert a string into an array