ES2024 JavaScript: Object.groupBy, Promise.withResolvers, and Array.from ...
ES2024 in WordPress scripts: Object.groupBy and Promise.withResolvers ECMAScript 2024 is a small edition, but two of its additions remove boilerplate that almost every admin script has: grouping an array with reduce() and capturing the resolve function of a promise in an outer variable. A third helper, Array.fromAsync(), is not part of ES2024 yet, but it…