Reputation: 391
df is an array of objects
I want to simplify this code, maybe the usage of Object.values
could be redundant if I use another thing than map
Object.values(df.map(o => o.prop))
This piece of code returns an array of props.
Is it possible?
Upvotes: 0
Views: 49
Reputation: 665286
Unless df
is a sparse array, the Object.values
is totally redundant indeed.
df.map(o => o.prop)
already returns the same value as
Object.values(df.map(o => o.prop))
Upvotes: 1