Supported JavaScript

To develop Lightning web components, use the latest versions of JavaScript.

LWC supports the same browsers as Lightning Experience—the latest stable versions of Edge, Chrome, Firefox, and Safari. To develop Lightning web components for these browsers, you can use any JavaScript feature that the browser supports and that Lightning Locker allows.

Lightning Web Security (LWS) is a newer security architecture for Lightning components that Salesforce first introduced in Spring ’22. LWS is based on the latest web standards and helps prevent unsafe code behavior by running components in virtual JavaScript sandboxes. To writer code that's compatible with LWS, use LWS tools.

Lightning Locker is the legacy security architecture for Lightning components. It provides component isolation and security that allows code from many sources to execute and interact using safe, standard APIs and event mechanisms. To write code that’s compatible with Locker, use Locker tools.

Both LWS and Lightning Locker enforce JavaScript strict mode.

To learn JavaScript (or if you want a refresher), start with the Modern JavaScript Development Trailhead module.

This developer guide explains how to develop Lightning web components and documents the LWC-specific JavaScript functions, such as for wire adapters that let you work with Salesforce data.

This developer guide doesn’t document standard JavaScript or teach JavaScript fundamentals. Standard JavaScript is documented in the Mozilla Developer Network (MDN) JavaScript Reference. If you’re looking for documentation for a function, try MDN first. For example, if you’re looking for information about addEventListener(), use MDN.

Salesforce ended support for Internet Explorer 11 on January 1, 2023. After Winter '24, you can no longer use Internet Explorer 11 and other legacy browsers to view or access Lightning Experience.

See Also