0

Converting a JS object to a string returns [object Object].

So I understand that [object Object] is the default string representation of a JavaScript object, but I still don't understand what any of that syntax is. It just looks like a comma-less array to me. What do the brackets mean? Why is 'object' written inside of the brackets twice, and capitalized once?

In response to duplication concerns: Other questions about [object Object] only ask what it is. I understand that [object Object] is the string representation of a JS object. I am asking specifically about the meaning of the syntax here.

David Kennell
  • 1,147
  • 2
  • 11
  • 22
  • 2
    http://stackoverflow.com/a/25419538/101087 – NineBerry May 18 '17 at 23:27
  • It's not anything specific. It does not represent any JS literal syntax. Anything else would have worked - `{davids Object}`. `[object …]` is just they way they chose. – Bergi May 19 '17 at 00:17

0 Answers0