I'm getting an error using Object.keys. HELP!

I am doing the “Enumerating Properties of an Object” lesson in Javascript for Mastery. When I do the example for Object.keys using For-of loops, save it, and log the result in the console, I get an error message that says "Object.keys is not a function. I’ve double-checked everything to make sure my syntax, along with everything else is correct. I’ve searched for a solution using MDN Docs and other links on the internet and I still havent been able to figure out what’s wrong. Please help! Thanks in advance.

Upload screen-shot of your code

Hey I apologize for the slow reply. I figured it out today. I had an extra line of code “function Object() {}” that was active. It should have been commented out. That was throwing the rest of the code off and causing the compiler to come up with the error message. Once I commented that out the rest of the code worked and I came up with the same result Mosh came up with in the training. I’ve attached screenshots so you can see what happened.

1 Like