+ 3
Javascript object not like array, does not have a length property. You need to get the keys array of the object, then only get the length of the keys array. eg. console.log(Object.keys(food).length);
25th Nov 2017, 10:32 AM
CalviŐČ
CalviŐČ - avatar
+ 1
return food.length;
25th Nov 2017, 9:09 AM
Momo Belia
Momo Belia - avatar
0
what error ? can you show me?
25th Nov 2017, 9:38 AM
Momo Belia
Momo Belia - avatar