Skip to content
Advertisement

i can’t get array b of object a with reduce in js

i can’t get array b of object a with reduce in js

can you help me find the error?

JavaScript

Advertisement

Answer

You can use Object.keys().

JavaScript

If you want the value of the property as the field instead, you can use Object.entries():

JavaScript

As a note, the [key, value] syntax is called array destructuring.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement