On This Month in JavaScript
JS features that became Baseline newly available in April
10 features · 5 years
The Math.sumPrecise() static method returns the sum of an iterable of numbers. It avoids the precision loss of intermediate partial sums, as found using reduce() or a loop to add together an array of values.
The Atomics.pause() static method gives a hint to the CPU that the code calling the method is in a short-duration wait for shared memory, known as spinning or a spinlock.
Module import … with { type: "json" } statements load JSON data. Also known as JSON module scripts.
The Intl.Segmenter API creates a locale-aware text splitter that can separate a string into meaningful graphemes, words, or sentences.
The Intl.DisplayNames API provides localized names of language, region, script, and currency codes.
The Intl.ListFormat API creates a locale-aware formatter that turns iterable objects into localized strings.
The async and await keywords allow you to use the asynchronous, promise-based behavior of a function without using promise chains.
The padStart() and padEnd() methods of strings return a string lengthened to a minimum number of characters by adding characters to the start or end of the string.
The WeakRef and FinalizationRegistry objects hold references to garbage-collectable objects without creating strong references that prevent their garbage collection.