From an array of objects, extract value of a property as array

Source: https://stackoverflow.com/questions/19590865/from-an-array-of-objects-extract-value-of-a-property-as-array

Here is a shorter way of achieving it:
let result = objArray.map(a => a.foo);
or
let result = objArray.map(({ foo }) => foo)

Không có nhận xét nào:

Is it okay to use both fetchpriority="high" and loading="eager" in img tag?

 https://stackoverflow.com/questions/77744344/is-it-okay-to-use-both-fetchpriority-high-and-loading-eager-in-img-tag Yes Fetchpriority and l...