Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

JS Tutorial

JS HOME JS Introduction JS Where To JS Output JS Statements JS Syntax JS Comments JS Variables JS Let JS Const JS Operators JS Arithmetic JS Assignment JS Data Types JS Functions JS Objects JS Object Properties JS Object Methods JS Object Display JS Object Constructors JS Events JS Strings JS String Methods JS String Search JS String Reference JS String Templates JS Numbers JS BigInt JS Number Methods JS Number Properties JS Number Reference JS Arrays JS Array Methods JS Array Search JS Array Sort JS Array Iterations JS Array Reference JS Array Const JS Dates JS Date Formats JS Date Get Methods JS Date Set Methods JS Math JS Math Reference JS Random JS Booleans JS Comparisons JS If Else JS Switch JS Loop For JS Loop For In JS Loop For Of JS Loop While JS Break JS Sets JS Set Methods JS Set Logic JS Set Reference JS Maps JS Map Methods JS Map Reference JS Typed Arrays JS Typed Methods JS Typed Reference JS Iterables JS Iterators JS typeof JS toString() JS Type Conversion JS Destructuring JS Bitwise JS RegExp JS Precedence JS Errors JS Scope JS Hoisting JS Strict Mode JS this Keyword JS Classes JS Modules JS JSON JS Debugging JS Style Guide JS Best Practices JS Mistakes JS Performance JS Reserved Words JS News 2025

JS Functions

Function Basic JS Arrow Function Function Definitions Function Parameters Function Invocation Function Call Function Apply Function Bind Function Closures

JS Objects

Object Definitions Object Prototypes Object Methods Object Properties Object Get / Set Object Protection

JS Classes

Class Intro Class Inheritance Class Static

JS RegExpc

JS RegExp Flags JS RegExp Classes JS RegExp Metachars JS RegExp Assertions JS RegExp Quantifiers JS RegExp Patterns JS RegExp Objects JS RegExp Methods

JS Async

JS Callbacks JS Asynchronous JS Promises JS Async/Await

JS Versions

JS Versions JS 2009 (ES5) JS 2015 (ES6) JS 2016 JS 2017 JS 2018 JS 2019 JS 2020 JS 2021 JS 2022 JS 2023 JS 2024 JS 2025 JS IE / Edge JS History

JS HTML DOM

DOM Intro DOM Methods DOM Document DOM Elements DOM HTML DOM Forms DOM CSS DOM Animations DOM Events DOM Event Listener DOM Navigation DOM Nodes DOM Collections DOM Node Lists

JS Browser BOM

JS Window JS Screen JS Location JS History JS Navigator JS Popup Alert JS Timing JS Cookies

JS Web APIs

Web API Intro Web Validation API Web History API Web Storage API Web Worker API Web Fetch API Web Geolocation API

JS AJAX

AJAX Intro AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples

JS JSON

JSON Intro JSON Syntax JSON vs XML JSON Data Types JSON Parse JSON Stringify JSON Objects JSON Arrays JSON Server JSON PHP JSON HTML JSON JSONP

JS vs jQuery

jQuery Selectors jQuery HTML jQuery CSS jQuery DOM

JS Graphics

JS Graphics JS Canvas JS Plotly JS Chart.js JS Google Chart JS D3.js

JS Examples

JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate

JS References

JavaScript Objects HTML DOM Objects


JavaScript News


New Features in JavaScript 2025

FeatureDescription
RegExp /v flag An "upgrade" to the /u (unicode) flag
RegExp.escape() Returns a string where regex characters are escaped
Float16Array A Typed Array that stores 16-bit floating-point numbers
Math.f16round() Returns the nearest 16-bit floating point number
Promise.try() Starts a promise chain for handling promise rejections
Import Attributes Import attributes allowed in import statements

New Set Features in 2025

FeatureDescription
union() Returns the union of two sets
intersection() Returns the intersection of two sets
difference() Returns the difference between two sets
symmetricDifference() Returns the symmetric difference between to sets
isSubsetOf() Returns true if this set is a subset of a given set
isSupersetOf() Returns true if this set is a superset of a given set
isDisjointFrom() Returns true if this set has no elements in in a given set

Warning

These features are relatively new.

Older browsers may need an alternative code (Polyfill)


New Features in JavaScript 2024

FeatureDescription
Object
groupBy()
Groups object elements according to values returned from a callback function
Map
groupBy()
Groups map elements according to values returned from a callback function
String
isWellFormed()
Returns true if a string is well formed
String
toWellFormed()
Returns a new string where "lone surrogates" are replaced with Unicode U+FFFD
Promise
withResolvers()
Atomics
waitAsync

New Features in JavaScript 2023

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 Feb 2023
FeatureDescription
#! (Shebang) Tells the operating system which interpreter to use to execute the script

New Array Features in 2023

FeatureDescription
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

New Features in JavaScript 2022

Supported in all modern browsers since March 2023.

Chrome 94 Edge 94 Firefox 93 Safari 16.4 Opera 80
Sep 2021 Sep 2021 Oct 2021 Mar 2023 Oct 2021
FeatureDescription
Array at() Returns an indexed element from an array
String at() Returns an indexed element from an string
RegExp /d Perform substring matches
Object.hasOwn() Check if a property is the own property of an object
error.cause Lets you specify the reason behind an error
await import Lets JavasSript modules wait for resources that require import before running.
Class field declarations Allows for properties to be defined directly within a class
Private methods and fields Allows for private properties (#method and #field)

New Features in JavaScript 2021

Supported in all modern browsers since April 2021.

Chrome 85 Edge 85 Firefox 79 Safari 14.1 Opera 71
Aug 2020 Aug 2020 Jul 2020 Apr 2021 Sep 2020
FeatureDescription
Promise.any() Takes promises as input and returns a single promise
String replaceAll() Replaces all occurrences of a substring in a string
Num Separator New numeric separator (_) makes numbers more readable

New Features in JavaScript 2020

Supported in all modern browsers since April 2021.

Chrome 80 Edge 80 Firefox 80 Safari 14.1 Opera 67
Feb 2020 Feb 2020 Aug 2020 Apr 2021 Mar 2020
FeatureDescription
BigInt Stores values too big to store in a JavaScript number
String matchAll() Searchs for all occurrences of a string in a string
Promise.allSettled() Takes promises as input and returns a single promise
Dynamic Import

New Operators in JavaScript 2020

OperDescription
?? Nullish coalescing returns the first argument not nullish
?. Optional chaining returns undefined if an object is undefined or null
&&= Logical AND assignment assigns the second value if the first value is true
||= Logical OR assignment assigns the second value if the first value is false
??= Nullish coalescing assignment assigns the second value if the first value is undefined or null

New Features in JavaScript 2019

Supported in all modern browsers since January 2020.

Chrome 73 Edge 79 Firefox 64 Safari 12.1 Opera 60
Mar 2019 Jan 2020 Des 2018 Mar 2019 Apr 2019
FeatureDescription
String trimStart() Removes whitespace from the start of a string
String trimEnd() Removes whitespace from the end of a string
Object.fromEntries Creates an object from key/value pairs
Optional catch binding Allows to omit the catch parameter if it is not needed
Array flat() Creates a new array by flattening a nested array
Array flatMap() Maps all array elements and creates a new array by flattening the array
Revised Array Sort() Browsers must now use a stable sorting algorithm
Revised JSON.stringify() Strings with UTF-8 code points now convert safely
Separator symbols in strings Line and paragraph separators (\u2028 and \u2029) are now allowed in strings
Revised Function.toString() Now returns source code including comments and spaces and syntax details

New Features in JavaScript 2018

Supported in all modern browsers since June 2020.

Chrome 64 Edge 79 Firefox 78 Safari 12 Opera 51
Jan 2018 Jan 2020 Jun 2020 Sep 2018 Feb 2018
FeatureDescription
Asynchronous Iteration Allows the await keyword in for/of loops
Promise Finally Schedules a function to be executed when a promise has been "fulfilled" or "rejected"
Array Rest Elements Allows to destruct an array and collect the leftovers
Object Rest Properties Allows to destruct an object and collect the leftovers
Shared Memory Allows different parts of a program to access the same memory

New RegExp Features JavaScript 2018

FeatureDescription
/s Allows the . (dot) metacharacter to match line terminators
\p{} Matches character with a Unicode character property
(?<=y) (?<=y)x matches "x" if "x" is preceded by "y"
(?<!y) (?<!y)x matches "x" if "x" is NOT preceded by "y"
(?<name>) Captures text and names (labels) it

New Features in JavaScript 2017

Supported in all modern browsers since September 2017.

Chrome 58 Edge 15 Firefox 52 Safari 11 Opera 45
Apr 2017 Apr 2017 Mar 2017 Sep 2017 May 2017
FeatureDescription
String padStart() Pads the beginning of a string
String padEnd() Pads the end of a string
Object entries() Returns an array of the key/value pairs of an object
Object values() Returns an array of the values of an object
async and await Simplifies the handling of promises
Trailing Commas Allows trailing commas where a comma-separated list of values is accepted
getOwnProperty
Descriptors
Returns an object containing all own property descriptors of an object

New Features in JavaScript 2016

Supported in all modern browsers since March 2017.

Chrome 52 Edge 15 Firefox 52 Safari 10.1 Opera 39
Jul 2016 Apr 2017 Mar 2017 May 2017 Aug 2016
FeatureDescription
** Raises the first operand to the power of the second
**= Raises the value of a variable to the power of the right operand
Array includes() Checks if an element is present in an array

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.