0

Javascript objects can accept an empty key with some value but how do we access the value of that empty key ?

var obj = {
    "": "Name"
}
Nina Scholz
  • 351,820
  • 24
  • 303
  • 358

1 Answers1

1

Try the following:

var obj = {"":"abc"};
console.log(obj[""]);
amrender singh
  • 7,430
  • 3
  • 20
  • 27