dimanche 28 décembre 2014

Is tid key reserved with JSON


When I log the json string of a key named tid, it always returns 0. Check the following example.



var transaction = {tid:1, type:0, time:126312736};
var transStr = JSON.stringify(transaction);
console.log(transStr);


The beginning part of that log looks like:



{"tid":0,"


When I change the key to something else like tidd, I get the expected value of 1. My question is why does that happen? Is tid reserved maybe?





Aucun commentaire:

Enregistrer un commentaire