ES stands for ECMAScript, which the standardized specification for scripting languages with JavaScript being the most popular implementation of ECMAScript. ECMAScript defines the syntax, semantics, and behavior of the Javascript programming language
ES5 (ECMAScript 5) was released in 2009 and brought several significant enhancements to JavaScript. Some notable features introduced in ES5 include:
- Strict Mode: ES5 introduced strict mode, which helps prevent common coding mistakes by enabling a stricter set of rules for JavaScript code.
- Function.prototype.bind: The bind method allows you to create a new function with a specific context (the this value) and pre-set arguments. It's useful for creating functions with a fixed context, particularly in event handlers.
- Array Methods: ES5 added several useful methods to the Array prototype, such as forEach, map, filter, reduce, and indexOf. These methods provide a more concise and functional programming-style approach to working with arrays.
- JSON: ES5 standardized the JSON object, providing methods like JSON.parse and JSON.stringify for parsing and stringifying JSON data.
ES6 (ECMAScript 2015), also known as ES2015, introduced many significant improvements and new features to JavaScript. Some key features introduced in ES6 include:
- Arrow Functions: Arrow functions provide a concise syntax for writing anonymous functions, with implicit returns and lexical scoping of this. They are especially useful for writing shorter and more readable code.
- let and const: ES6 introduced block-scoped variables let and const, which offer alternatives to the previously used var keyword. let allows declaring variables with block scope, while const is used for defining constants.
- Classes: ES6 introduced a more straightforward syntax for creating classes in JavaScript, using the class keyword. Classes provide a way to define object blueprints and create instances with shared methods and properties.
- Modules: ES6 introduced a standardized module system, allowing JavaScript code to be organized into separate files with explicit dependencies and exports. This promotes modularity and helps in building larger applications.
- Template Literals: Template literals provide an improved way to concatenate strings and embed expressions using backticks ( ``). They support multi-line strings and expression interpolation.
- Destructuring Assignment: Destructuring allows you to extract values from arrays or objects into individual variables, providing a concise way to access nested data structures.
These are just a few highlights of the features introduced in ES5 and ES6. Subsequent versions of ECMAScript, such as ES2016, ES2017, and so on, have brought further enhancements and new features to JavaScript.
'2023 공부한것들' 카테고리의 다른 글
[Node.js] An Introduction to Routing in Client/Server Applications (0) | 2023.06.19 |
---|---|
WIL : 20230614-20230618 (0) | 2023.06.18 |
[node.js] making a simple web server with node (0) | 2023.06.18 |
[node js] npm (0) | 2023.06.18 |
[TIL] 20230618 : what's your name? (0) | 2023.06.18 |