Object.groupBy() - JavaScript | MDN

developer.mozilla.org

Tin mới

HTML: Markup language

See all HTML references

Date & time formats

See all HTML guides

CSS: Styling language

See all CSS references

See all CSS guides

Centering an element

JavaScript: Scripting language

Standard built-in objects

Expressions & operators

Statements & declarations

See all JavaScript references

Control flow & error handing

Loops and iteration

Working with objects

See all JavaScript guides

Web APIs: Programming interfaces

Service worker API

Using the Web animation API

Using the Fetch API

Working with the History API

Using the Web speech API

All web technology

Progressive web apps

Learn web development

Getting started modules

Structuring content with HTML module

CSS styling basics module

Dynamic scripting with JavaScript module

Border-image generator

Border-radius generator

Box-shadow generator

Color format converter

null-prototype object

A null-prototype object with properties for all groups, each assigned to an array containing the elements of the associated group.

coerced to strings

The elements in the returned object and the original iterable are the same (not deep copies). Changing the internal structure of the elements will be reflected in both the original iterable and the returned object.

object destructuring syntax for function arguments

First we define an array containing objects representing an inventory of different foodstuffs. Each food has a type and a quantity.

Indexed collections

Array.prototype.reduce()

Object.fromEntries()

Learn how to contribute

This page was last modified on Jul 10, 2025 by MDN contributors.

defineProperties()

getOwnPropertyDescriptor()

getOwnPropertyDescriptors()

getOwnPropertyNames()

getOwnPropertySymbols()

preventExtensions()

__defineGetter__()

__defineSetter__()

__lookupGetter__()