DEV Community

loading...

Discussion on: Is it possible to nest an array in a JavaScript object?

Collapse
roelofjanelsinga profile image
Roelof Jan Elsinga

What Ian said is the correct answer. An object needs properties and those properties can have any value. So the property in Ian's answer is "an_array" and the value is the actual array. To retrieved this array in your code, you'd have to use: obj.an_array