javascript - %j specifier in console.log excludes some properties -
I recently used to load the Finally I came to know that it was because I was using Here is an example: And here is the output: I thought that since It leads me to believe that whatever Related Tags: This is it, in passing your So, what happens when the If a deadline, a function, or a symbol is encountered during conversion, then it is omitted or left (when it is found in the object) or empty Sensor is done (when it is found in an array). () Therefore the behavior you are seeing is completely expected, you are trying to log something as bson (binary JSON) module in the
node Was trying. Js . API documents were not clear, so I thought inspecting the object would help me, the results of the inspection started to flare up.
% j which is "false" - this is an object's chips! (I am using Python terminology for "attributes" as things referred to with dot, and "dictionary keys" for things referenced with brackets, because I do not know the proper name for these things in JS.)
requires var bson = ("BSN"); Console.log ("%% as Seasoning: Jay J:% J", BSN); Console.log ("BSN as console.log:", BSON);
bson% j: as {"BSonPure": {}, "BSONNative": {}} of the console BSN log in form: {code: [function: code], symbol: [function: symbol], BSON: {[function: BSON] BSONIGT 32_MX: 2147483647, BSONItTMRM: -2147483648, BSONIdt64_mx: 9223372036854776000, BSONIIT 64_MIN: -9223372036854776000, ..
x.key is the same form as
x ["key"] , it means that The properties and the dictionary key are "the same thing" in JS I think that
is BSON.BSONPure
{} , but
BSON.BSONPure.BSON And
BSON.BSONPure ["BSON"] is a
function object!
"% j" does, some keys somehow. How does it determine which key to exclude? why will? JS is really confusing language!
node.js ,
% j placeholder result in a call
JSON.stringify () passed on the logic.
BSON variable, you are not passing valid
JSON objects, you can pass a node. JS module Which are exporting functions among other things.
JSON.stringify () hits the function?
JSON that is not valid Is
JSON .
& gt; JSON.stringify ({name: "Bob"}) & gt; "{" Name ":" bob "}" & gt; JSON.stringify ({func: function () {}}) & gt; "{}"
Comments
Post a Comment