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