JavaScript

JavaScript is the scripting language of the web. It provides rich interactivity and dynamic content for web applications. With it, you can build user experiences that can help users accomplish complex tasks, store user data, and more. Here, you can peruse our collection of JavaScript content and learn a variety of concepts and techniques to help you improve your JavaScript skills.

Jump ahead on this page:

Learn JavaScript

If you're new to JavaScript, we've got you covered. Our Learn JavaScript course teaches the ins and outs of JavaScript, helping you to get up to speed.

Baseline Newly available JavaScript features

Learn about the latest JavaScript features that are newly available in all major browser engines.

Get familiar with common and useful JavaScript features

JavaScript provides many features to help you build applications that respond to the needs of your users.

Optimize poor INP caused by JavaScript

Interaction to Next Paint (INP) is an important responsiveness metric that measures page responsiveness. These guides contain JavaScript tips to help you keep your pages responsive to users.

Optimize third-party JavaScript resources

Third-party JavaScript can be a cause of performance issues in web applications. Learn how to manage third-party scripts to keep your web applications fast.

Dive into JavaScript patterns

Check out these JavaScript patterns you can use to quickly accomplish common tasks in your web applications.
COURSE

New to JavaScript?

If you're new to JavaScript, we've got you covered. Our Learn JavaScript course guides you through how JavaScript works, beginning with the basics such as variables, functions, and conditional statements. From there, you'll tackle more complex topics such as prototypal inheritance, classes, and other topics to help you hone your JavaScript skills so that you can build rich web applications.

Baseline Newly available JavaScript features

Baseline signals to web developers when web platform features can be safely used in all major browser engines. Here are some JavaScript features that are now Baseline Newly available.

Promise.try()

Promise.try() became Baseline Newly available in January 2025.

Resizable ArrayBuffer

Resizable ArrayBuffer became Baseline Newly available in July 2024.

Set methods

Set methods became Baseline Newly available in June 2024.

CustomStateSet

CustomStateSet became Baseline Newly available in May 2024.

Screen Wake Lock API

The Screen Wake Lock API became Baseline Newly available in May 2024.

intl.Segmenter

intl.Segmenter became Baseline Newly available in April 2024.

Promise.withResolvers()

promise.withResolvers() became Baseline Newly available in March 2024.

groupBy() functions

groupBy() functions became Baseline Newly available in March 2024.

ArrayBuffer transfer() and transferToFixedLength()

The ArrayBuffer transfer() and transferToFixedLength() methods became Baseline Newly available in March 2024.

Array fromAsync() static method

Array.fromAsync() became Baseline Newly available in January 2024.

Get familiar with common and useful JavaScript features

JavaScript gives you a lot of tools to help you build applications that respond to the needs of your users. Here are some common features might want to use in your web applications that are worth knowing about!

Promises

Promises allow you to asynchronously execute code after a certain event occurs.

The fetch API

The fetch API allows you to make HTTP requests to fetch data from the web on the front end.

IndexedDB

The IndexedDB API offers client-side storage of structured data, including files and blobs.

Optimize poor INP caused by JavaScript

How you use JavaScript can have an effect on your web application's Interaction to Next Paint (INP). These guides will help you to get a handle on page repsonsiveness issues caused by JavaScript.

Optimize long tasks

Long tasks on the main thread can cause your web application to be unresponsive. Learn how to optimize long tasks to improve your web application's INP.

Optimize input delay

Long input delays occur when users interact with a page and the browser takes too long respond—and JavaScript can be a common culprit. Read this guide and learn how you can keep input delays shorter and your web application snappier.

Script evaluation and long tasks

When scripts are downloaded during page load, they can cause long tasks that can affect your web application's INP. Learn how to optimize for long script evaluation tasks to keep your INP low.

Use web workers to run JavaScript off the browser's main thread

Not everything needs to run on the main thread. If you have large batches of work that take a long time to run, you can offload them to web worker threads to keep your web application as responsive as it can be.

Optimize third-party JavaScript resources

A common performance problem on the web involves the use of third-party JavaScript, which can cause pages to load more slowly and even cause problems with page responsiveness. Check out these guides to get a handle on some common third-party JavaScript performance problems.

Third-party JavaScript performance

Find out how third-party JavaScript can affect performance and what you can do to keep it from slowing down your sites.

Identify slow third-party JavaScript

Supercharge your performance detective skills with Lighthouse and Chrome DevTools.

Efficiently load third-party JavaScript

Learn how to load third-party JavaScript efficiently so you can improve the performance of your web applications.

Best practices for tags and tag managers

Learn how to optimize tags and tag managers for Core Web Vitals, so that these useful tools have the least impact on your web application's performance.

Dive into JavaScript patterns

Check out these patterns you can use to quickly accomplish common tasks in your web applications using JavaScript.

Web applications

Check out these patterns to accomplish common tasks in your web applications.

Files and directories

Learn patterns for working with files and directories in JavaScript.

Clipboard

Learn how to use Clipboard APIs in JavaScript to provide copy and paste functionality in your web applications.