Intermediate JavaScript
Q75 / 100

What is the purpose of Object.entries() and how is it commonly used?

Correct! Well done.

Incorrect.

The correct answer is B) Returns an array of [key, value] pairs for own enumerable properties, useful for iteration and conversion

B

Correct Answer

Returns an array of [key, value] pairs for own enumerable properties, useful for iteration and conversion

Explanation

Object.entries(obj).map(([k, v]) => [k, transform(v)]) then Object.fromEntries(...) is a common pattern for transforming object values.

Progress
75/100