You are reading a single comment by @Sacha and its replies. Click here to read the full conversation.
  • Hi,

    Have some problem with JSON.parse.

    test={};
    test['myname']='ESP:33FFD705-41573033-27620843';
    test['first']={"pin":A15};
    
    console.log('Orig:');
    console.log(test);
    
    json=JSON.stringify(test);
    
    console.log('JSON:');
    console.log(json);
    
    console.log('Back:');
    console.log(JSON.parse(json));
    

    Here is the output:

    Orig:
    {
      "myname":"ESP:33FFD705-41573033-27620843",
      "first":{"pin":A15}
    }
    JSON:
    {"myname":"ESP:33FFD705-41573033-27620843","first":{"pin":A15}}
    Back:
    undefined
    =undefined
    

    Back is undefined. I expected the same as 'test'.

    Thanks
    Sacha

About

Avatar for Sacha @Sacha started