What is ES?
In the year 1996, a standard organization called ECMA (European Computer Manufacturers Association) international craved ECMA Script (ES) which all browser vendors could implement. And Java Script is the most well-known implementations of ES, while Action Script and Jscript are other implementation of ES.
List of Version from ES:
To date, ES has publishes nine versions and the latest one was published in the year 2018. ECMA Script’s first three versions- ES1, ES2, ES3 were yearly updates whereas, ES4 was never released due to political disagreements. After a decade, ES5 was eventually released with several additions.
ES5 was released in 2009, ten years after the release of its previous version. Here is a list of features that have come with the es5 version.
- ‘Use strict’ Directive: The earlier versions of JS allow the usage of undeclared variables.
- New Methods in an Array:
- IsArray (): This method checks if the object is an array or not and returns the result as true or false.
- forEach (): It executes the function for every element found in the array.
- map(): the map() method creates a new array by mapping every element of the array.
- filter(): It creates a new array that contains elements which got filtered by making array elements pass some condition.
- reduce(): It applies a function to each element in an array and reduces the array to a single element.
JS has shown great progress in recent years starting from 2015 by releasing the ES6 version.
- Left & const: JS has only function scope and global scope with the introduction of let keyword in ES6.
- Default Parameters: Provides default values to function parameters if no value or undefined is passed.
- Rest Operator: Rest operator is used to handling function parameters. It uses three dots as its syntax.
- Spread Operator: Spread Operator is used with arrays and its syntax is exactly the same as that of Rest Operator.
- Destructuring: Destructuring helps in unpacking values from an array or an object.
Es7 or ECMA Script 2016 was released in the year 2016. This version gives suitable alternative s to already used functionalities.
- Includes (): Return true if an array includes a value, if not return false.
- Padstart(): This method pads a string with another string at the beginning.
- Padend(): This method pads a string with another and makes the resulting string reach a given length.