What’s the best way (most efficient) to turn all the keys of an object to lower case?
The fastest I come up with is if you create a new object: var key, keys = Object.keys(obj); var n = keys.length; var newobj={} while (n–) { key = keys[n]; newobj[key.toLowerCase()] = obj[key]; } I’m not familiar enough with the current inner working of v8 to give you a definitive answer. A few years ago … Read more