bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/JavaScript/Debugging, Projects, and Reference
JavaScript•Debugging, Projects, and Reference

ECMAScript 2023

New Features in JavaScript 2023

Feature

Description

#! (Shebang) Tells the operating system which interpreter to use to execute the script

New Array Features in 2023

Feature

Description findLast()

Returns the value of the last element that satisfies a condition findLastIndex() Returns the index of the last element that satisfies a condition toReversed() Reverses an array without altering the original array toSorted() Sorts an array without altering the original array toSpliced() Splices an array without altering the original array with() Updates array elements without altering the original array

Browser Support

ECMAScript 2023 is supported in all modern browsers since

July 2023

Chrome

110

Edge

110

Firefox

115

Safari

16.4

Opera

96

Feb 2023

Feb 2023

Jul 2023

Mar 2023

May 2023

JavaScript Array findLast() Method

ES2023 added the findLast() method that will start from the end of an array and return the value of the first element that satisfies a condition.

Example

const temp = [27, 28, 30, 40, 42, 35, 30];
let high = temp.findLast(x => x > 40);

JavaScript Array findLastIndex() Method

The findLastIndex() method finds the index of the last element that satisfies a condition.

Example

const temp = [27, 28, 30, 40, 42, 35, 30];
let pos = temp.findLastIndex(x => x > 40);

JavaScript Array toReversed() Method

ES2023 added the Array toReversed() method as a safe way to reverse an array without altering the original array.

The difference between the new toReversed()

method and the old reverse() method is that the new method creates a new array, keeping the original array unchanged, while the old method altered the original array.

Previous

Project - Modal Popup

Next

JavaScript Debugging Async