0
我有一個物體,卡片,它由其他物體組成。如何讓對象返回一個對象而不是字符串?
當我通過卡循環時,我期望其他對象得到返回。相反,只返回一個字符串。我已經在下面的代碼中包含了內聯返回的內容。
console.log(typeof cards); //returns object
console.log(cards); //returns the 3 objects: [Object, Object, Object]
console.log(cards.length); //returns 3
for (var card in cards){
console.log(typeof card); //returns 0,1,2 as a string, but it should return another object
};