ECMAScript 2023 adds new methods for searching and changing arrays, allows symbols to be used as WeakMap keys, and standardizes support for hashbang grammar. Credit: Bigc Studio / Shutterstock ECMAScript 2023, an update to the official specification for the JavaScript programming language, has been approved by ECMA International. The new spec adds new methods for searching and changing arrays, extends the WeakMap API to allow unique symbols, and introduces some standardization for the use of hashbangs. Approved on June 27, the ECMAScript 2023 specification cites the following synopsis of improvements: ECMAScript 2023, the 14th edition, introduced the toSorted, toReversed, with, findLast, and findLastIndex methods on Array.prototype and TypedArray.prototype, as well as the toSpliced method on Array.prototype; added support for #! comments at the beginning of files to better facilitate executable ECMAScript files; and allowed the use of most Symbols as keys in weak collections. The finished proposals, published by the ECMA TC39 (Technical Committee 39) on GitHub, elaborate on the four features to be published this year: Array find from last, a proposal for .findlast() and .findLastIndex() methods on array and typed array. Finding an element in an array is a very common programming pattern, the proposal states. Scenarios under which this feature would be used include when a developer knows that finding an element from last to first may have better performance, or developers care about the order of the elements. Permitting symbols as keys in WeakMap keys, a proposal that extends the WeakMap API to allow the use of unique symbols as keys. Currently, WeakMaps are limited to allow only objects as keys. Change array by copy, a proposal that provides additional methods on Array.prototype and TypedArray.prototype to enable changes on the array by returning a new copy of it with the change. Hashbang grammar, a proposal to match the de facto usage in some CLI JS hosts that allow for Shebangs/Hashbang. These hosts strip the hashbang to generate valid JS source texts before passing to JS engines. This plan would move the stripping to engines and unify and standardize how that is done. Updated versions of ECMAScript traditionally are finalized by ECMA in June. Last year’s ECMAScript 2022 featured class elements and top-level await capabilities. Related content feature What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages news F# 9 adds nullable reference types Latest version of Microsoft’s functional .NEt programming language provides a type-safe way to handle reference types that can have null as a valid value. By Paul Krill Nov 18, 2024 3 mins Microsoft .NET Programming Languages Software Development news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos