console.log(dataJson); 

It gives the result: {"UserChannelId":"cb4a62ba4af3ab722b599b270","title":"test"}

and for some reason, this: console.log(dataJson.UserChannelId); gives the result: undefined

What could be the problem?

  • what gives console.log(typeof dataJson) - Yura Ivanov
  • Gives a string - IOleg
  • Everything works in chrome - Error
  • this is node.js on the server - IOleg
  • one
    if dataJson is a string, then do either: dataJson = JSON.parse (dataJson); console.log (dataJson.UserChannelId); Or dig the settings of the one who returned this data to you. - Yura Ivanov

0