Use Object.keys().

Sometimes it's obvious I wrote this when I was still learning
javascript.