[SOLVED] Access JavaScript object

sorry for posting a non playCanvas specific Question :frowning:
But the title reads coding after all and I’m a little forlorn :slight_smile:
I get a JSON with my Map from jsonbin.io : Map = { “Height” : “4” , “Length” : “3” … }
can parse it into an JavaScript object JSON.parse(Map) and get : { ‘Height’ : 4 , ‘Length’ : 3 , … }
as far as good, but I cant access any value :-(. Not by:

  • dotNotation -> Map.Height
  • brackets -> Map[‘Height’]
  • or Object.value(Map)
    checked for typing error and lost spaces " " and running out of ideas what to do or where to look

Hi @Gurki,

Try doing this:

var data = JSON.parse(Map); // parse the JSON string
console.log(data.Height); // should print 4

i know it should, but i does:
Cannot read property ‘Height’ of undefined

solved :smiley:

did not know why, but after deleting dataset severside and loaded them up again, i’ve full access :smiley: sorry for disturbing You on Sunday …

1 Like