0
我試圖讓在上述對象中的每個鍵的小寫值。對象foo有沒有方法「toLowercase」
for (each in {'foo':'bar','bar':'foo'}) {
console.log(typeof each, each.toLowercase());
}
我得到的錯誤是Object foo has no method 'toLowercase'
,但typeof each
回報'string'
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/toLowerCase – Ian 2013-04-25 03:53:25