DEV Community

Cover image for πŸš€ JavaScript Challenge β€” What Happens Here?
Muhaymin Bin Mehmood
Muhaymin Bin Mehmood

Posted on

πŸš€ JavaScript Challenge β€” What Happens Here?

Here’s a small snippet for you:

let user = {
    first name: "John",
    age = 30
};

console.log(user);
Enter fullscreen mode Exit fullscreen mode

What will happen when you run this code?

Possible outcomes:

  1. { first name: "John", age: 30 }
  2. SyntaxError
  3. undefined
  4. null

πŸ’¬ Your turn: Drop your answer in the comments and explain your reasoning.

I break down this and other tricky "Unexpected Token" cases in detail in my latest guide:
πŸ‘‰ Read the full article here

Top comments (0)