+ 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);
+ 1
return food.length;
0
what error ? can you show me?