0

if we write property names as strings we can still access the property with .(dot) notation as mentioned below

let x = {

        "footnotes": "Footnotes",
        "menu": "Menu",
        "i": "Information",
        "objection": "objection",
        "menu": "Menu",
        "zoomNote": "zoomNote"

}
Prasad Telkikar
  • 15,207
  • 5
  • 21
  • 44
  • JSON is *always* text. It's specifically a serialisation format similar to how XML is also a serialisation format. You have to parse the serialised data into something usable by your application (process called *deserialisation*). Again, similar to how you can read XML into something you can manipulate. In JavaScript object literal notation *looks* similar to JSON but is not actually JSON, as it doesn't need deseralisation. The similarity is because JSON was styled to look like object literals but that's it - the two are still different. – VLAZ Jul 22 '20 at 06:28
  • Thank you @prasad!! And my real doubt is...when i fetch an API directly it looks like key value pair, may I assume it as JS object literal? – RAVI TEJA NANI Jul 23 '20 at 14:01

0 Answers0