Skip to main content
Note #23

Pop quiz: What does the following evaluate to in JavaScript?

Object.keys('hmm...').length

Answer: 6. Here JS treats the string as a type of array which itself is a type of object. Who knew!

Browse all notes