ecmascript_2017

ECMAScript 2017 - JavaScript ES8

ECMAScript 2017 - ES8

Return to JavaScript History, ECMAScript, JavaScript Versions (ECMAScript Version History), JavaScript Topics

Given the constraints and the detailed nature of your request, I'll provide a concise summary of ECMAScript 2017 (ES8) features, along with examples, comparisons, and relevant links. This overview will focus on the key features rather than an exhaustive paragraph-per-feature breakdown.

Introduction to ECMAScript 2017

ECMAScript 2017, also known as ES8, introduced several significant features and improvements to JavaScript, enhancing its capabilities for developers and making the language more powerful and flexible.

Official Resources

Async Functions

Async Functions provide a simpler and cleaner way to work with asynchronous code, using the `async` and `await` keywords. JavaScript Code Example: ```javascript async function fetchData() {

 const data = await fetch('url');
 return data.json();
} ``` In comparison, Python uses async def and await for similar functionality. Java has CompletableFuture for asynchronous programming, and TypeScript, being a superset of JavaScript, directly supports `async` and `await`.

Object.values() and Object.entries()

These functions return an array of the object's enumerable property values and an array of the object's own enumerable string-keyed property `[key, value]` pairs, respectively. JavaScript Code Example: ```javascript const obj = { a: 1, b: '2', c: true }; console.log(Object.values(obj)); // [1, “2”, true] console.log(Object.entries(obj)); // "a", 1], ["b", "2"], ["c", true ``` Python's `dict.values()` and `dict.items()` offer similar functionality. Java can use `Map.values()` and `Map.entrySet()`. TypeScript supports these JavaScript methods directly.

String Padding

`String.prototype.padStart()` and `String.prototype.padEnd()` allow padding to the start and end of a string, respectively. JavaScript Code Example: ```javascript console.log('ES8'.padStart(4, '0')); // “0ES8” console.log('ES8'.padEnd(4, '0')); // “ES80” ``` This functionality is akin to Python's `str.ljust()`, `str.rjust()`, and `str.center()` methods. Java's `String.format()` can achieve similar outcomes. TypeScript inherits these methods from JavaScript.

Object.getOwnPropertyDescriptors

This method returns all own property descriptors of a given object. JavaScript Code Example: ```javascript const obj = { a: 1 }; console.log(Object.getOwnPropertyDescriptors(obj)); ``` This feature is unique to JavaScript and doesn't have a direct equivalent in Python or Java, where property descriptors are not a commonly used pattern. TypeScript, as with other ES8 features, supports this method.

Trailing Commas in Function Parameter Lists and Calls

Trailing commas are now allowed in function parameter lists and calls, improving version control diffs. JavaScript Code Example: ```javascript function example(a, b, c,) {

 // Function body
} example(1, 2, 3,); ``` This syntax improvement is more about consistency with array and object literals than a new feature in other languages. Python supports trailing commas in function definitions and calls. Java does not support trailing commas in method or constructor parameter lists.

Shared Memory and Atomics

`SharedArrayBuffer` and `Atomics` provide primitives for high-performance, concurrent programming, allowing data to be shared between workers/threads. JavaScript Code Example: ```javascript // Not provided due to complexity and the need for a multi-threaded context ``` This feature introduces concurrency features reminiscent of those found in languages like Java, which has a rich set of concurrency utilities. Python has the `threading` and `multiprocessing` modules, but JavaScript's shared memory model is unique due to its web-based, single-threaded context. TypeScript supports these features as they are part of the ECMAScript standard.

Conclusion

ECMAScript 2017 brought significant enhancements to JavaScript, including syntactic sugar for easier readability and new functionalities for more efficient programming. Each feature has parallels in other programming languages, indicating JavaScript's ongoing evolution to match and sometimes exceed the capabilities of its contemporaries. For detailed exploration of all features and updates, the provided links to official resources are invaluable.

https://en.wikipedia.org/wiki/ECMAScript_version_history#ES2017

Snippet from Wikipedia: ECMAScript version history

ECMAScript is a JavaScript standard developed by Ecma International. Since 2015, major versions have been published every June.

ECMAScript 2024, the 15th and current version, was released in June 2024.

JavaScript Version History: JavaScript, ECMAScript. ECMAScript 2022 (2022), ECMAScript 2021 (2021), ECMAScript 2020 (2020), ECMAScript 2019 (2019), ECMAScript 2018 (2018), ECMAScript 2017 (2017), ECMAScript 2016 (2016), ECMAScript 2015 (2015), ECMAScript 5.1 (2011), ECMAScript 5 (2009), ECMAScript 4 (2009), ECMAScript 3 (1999), ECMAScript 2 (1998), JavaScript 1.5 (2000), JavaScript 1.4 (1998), JavaScript 1.3 (1996), JavaScript 1.2 (1997), JavaScript 1.1 (1996, JavaScript 1.0 (1997. (navbar_javascript_versions - see also navbar_javascript, navbar_typescript_versions

JavaScript: JavaScript Fundamentals, JavaScript Inventor - JavaScript Language Designer: Brendan Eich of Netscape on December 4, 1995; JavaScript DevOps - JavaScript SRE, Cloud Native JavaScript (JavaScript on Kubernetes - JavaScript on AWS - JavaScript on Azure - JavaScript on GCP), JavaScript Microservices, JavaScript Containerization (JavaScript Docker - JavaScript on Docker Hub), Serverless JavaScript, JavaScript Data Science - JavaScript DataOps - JavaScript and Databases (JavaScript ORM), JavaScript ML - JavaScript DL, Functional JavaScript (1. JavaScript Immutability, 2. JavaScript Purity - JavaScript No Side-Effects, 3. JavaScript First-Class Functions - JavaScript Higher-Order Functions, JavaScript Lambdas - JavaScript Anonymous Functions - JavaScript Closures, JavaScript Lazy Evaluation, 4. JavaScript Recursion), Reactive JavaScript), JavaScript Concurrency (WebAssembly - WASM) - JavaScript Parallel Programming - Async JavaScript - JavaScript Async (JavaScript Await, JavaScript Promises, JavaScript Workers - Web Workers, Service Workers, Browser Main Thread), JavaScript Networking, JavaScript Security - JavaScript DevSecOps - JavaScript OAuth, JavaScript Memory Allocation (JavaScript Heap - JavaScript Stack - JavaScript Garbage Collection), JavaScript CI/CD - JavaScript Dependency Management - JavaScript DI - JavaScript IoC - JavaScript Build Pipeline, JavaScript Automation - JavaScript Scripting, JavaScript Package Managers (Cloud Monk's Package Manager Book), JavaScript Modules - JavaScript Packages (NPM and JavaScript, NVM and JavaScript, Yarn Package Manager and JavaScript), JavaScript Installation (JavaScript Windows - Chocolatey JavaScript, JavaScript macOS - Homebrew JavaScript, JavaScript on Linux), JavaScript Configuration, JavaScript Observability (JavaScript Monitoring, JavaScript Performance - JavaScript Logging), JavaScript Language Spec - JavaScript RFCs - JavaScript Roadmap, JavaScript Keywords, JavaScript Operators, JavaScript Functions, JavaScript Built-In Data Types, JavaScript Data Structures - JavaScript Algorithms, JavaScript Syntax, JavaScript OOP (1. JavaScript Encapsulation - 2. JavaScript Inheritance - 3. JavaScript Polymorphism - 4. JavaScript Abstraction), JavaScript Design Patterns - JavaScript Best Practices - JavaScript Style Guide - Clean JavaScript - JavaScript BDD, JavaScript Generics, JavaScript I/O, JavaScript Serialization - JavaScript Deserialization, JavaScript APIs, JavaScript REST - JavaScript JSON - JavaScript GraphQL, JavaScript gRPC, JavaScript on the Server (Node.js-Deno-Express.js), JavaScript Virtualization, JavaScript Development Tools: JavaScript SDK, JavaScript Compiler - JavaScript Transpiler - Babel and JavaScript, JavaScript Interpreter - JavaScript REPL, JavaScript IDEs (Visual Studio Code, JavaScript Visual Studio Code, Visual Studio, JetBrains WebStorm, JetBrains JavaScript), JavaScript Debugging (Chrome DevTools), JavaScript Linter, JavaScript Community - JavaScriptaceans - JavaScript User, JavaScript Standard Library (core-js) - JavaScript Libraries (React.js-Vue.js-htmx, jQuery) - JavaScript Frameworks (Angular), JavaScript Testing - JavaScript TDD (JavaScript TDD, Selenium, Jest, Mocha.js, Jasmine, Tape Testing (test harness), Supertest, React Testing Library, Enzyme.js React Testing, Angular TestBed), JavaScript History, JavaScript Research, JavaScript Topics, JavaScript Uses - List of JavaScript Software - Written in JavaScript - JavaScript Popularity, JavaScript Bibliography - Manning JavaScript Series- JavaScript Courses, JavaScript Glossary - JavaScript Official Glossary, TypeScript, Web Browser, Web Development, HTML-CSS, JavaScript GitHub, Awesome JavaScript, JavaScript Versions. (navbar_javascript - see also navbar_web_development, navbar_javascript_versions, navbar_javascript_standard_library, navbar_javascript_libraries, navbar_javascript_reserved_words, navbar_javascript_functional, navbar_javascript_concurrency, navbar_javascript async)


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


ecmascript_2017.txt · Last modified: 2024/05/01 03:52 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki