1

I am using javascript in browser's console and defining a variable as :

const name = {firstName: 'hello', lastName: 'world'};

Whenever I'm trying to log name, it gives me [object Object], instead of giving me Object: {firstName: "hello", lastName: "world", __proto__: Object}

However when I'm creating a constant of other variable name, it is working fine

[Edit]: Snippet of code :

enter image description here

Ajay Gaur
  • 5,140
  • 6
  • 38
  • 60

0 Answers0