문제

I'm trying to get a lowercase value of each key in said object.

for (each in {'foo':'bar','bar':'foo'}) {
    console.log(typeof each, each.toLowercase());
}

The error I get is Object foo has no method 'toLowercase', yet typeof each returns 'string'

도움이 되었습니까?

해결책

It's toLowerCase() with a capital "C".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top