Measure your own code performance precisely โฑ๏ธ
`performance.mark()` and `performance.measure()` let you instrument JavaScript with high-precision timings.
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark
The official MDN Web Docs account. We deliver the best web docs around.
Visit โ https://mdn.dev
Contribute โ https://mdn.dev/community
| Home | https://developer.mozilla.org |
| GitHub | https://github.com/mdn |
| Blog | https://mdn.dev/blog |
| Discord | https://mdn.dev/discord |
Measure your own code performance precisely โฑ๏ธ
`performance.mark()` and `performance.measure()` let you instrument JavaScript with high-precision timings.
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark
Creating a resolvable Promise just got cleaner ๐งน
`Promise.withResolvers()` returns { promise, resolve, reject }
No more wrapping logic inside the constructor.
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
Run non-critical work without blocking the UI ๐ค
`requestIdleCallback()` schedules tasks during browser idle time.
โ ๏ธ Limited Availability
โ
Runs only when the main thread is free
โ
Great for analytics, prefetching, and cleanup
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
Create frosted glass effects in CSS ๐ช
backdrop-filter applies visual effects to the content behind an element โ blur, brightness, contrast, and more.
backdrop-filter: blur(10px) brightness(0.9);
No JavaScript. No canvas tricks.
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter
Wait for all promises, even the failing ones ๐
`Promise.allSettled()` waits for every promise to finish, success or failure.
โ
Returns { status: 'fulfilled', value } or { status: 'rejected', reason }
โ
Perfect for batch operations
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled
Stop scroll chaining with overscroll-behavior ๐
Prevent modals and sidebars from accidentally scrolling the page behind them.
โ
Works on any scrollable element
โ
Also controls the bounce effect on mobile
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior
Access characters from the end of a string with .at() โจ
str.at(-1) gets the last character, no more str[str.length - 1] gymnastics.
Works on strings, arrays, and typed arrays.
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/at
๐ The URL Pattern API is Newly Available!
Use it to match and extract parts of URLs, no need to reinvent routing logic. Supports literals, wildcards, named groups, and even regex constraints.
Learn how it works ๐
https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API
๐ฌ Check own properties safely with Object.hasOwn()
A safer alternative to hasOwnProperty, works even on objects with a null prototype.
Baseline since 2022 โ
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
Maintain perfect proportions with CSS aspect-ratio ๐
No more padding-top hacks for 16:9 videos or square avatars.
aspect-ratio: 16 / 9;
โ
Works with any box model
โ
Respects min/max dimensions
โ
Baseline since 2021 โ
Learn more ๐
https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio