0
How do you iterate thru an array that is a property value?
Need help with this algorithim https://code.sololearn.com/WuvgMnbd50kx/?ref=app
1 ответ
+ 1
Try
var contains = hobbies[property1].includes(hobby);
Please note that iterating using in keyword would get the keys of the object, not the properties.
let key in object.
If you want to access object properties from iteration all objects, use
for (let property1 of Object.values(hobbies))