code:
var util = require('util')
var body = '{doc}'
try{
body = JSON.parse(body)
}catch(err){
console.log(util.inspect(err))
}
The same code running on different versions giving different results
node 6.x.x: (inspect is not working)
SyntaxError: Unexpected token i in JSON at position 1
at Object.parse (native)
on node 0.x.x:
[SyntaxError: Unexpected token i]
PS: I have used depth null, still am getting same results on nodev6
via new_programmer
No comments:
Post a Comment