2020-3-27 native JS / ZL11: an array of printing the acquired name, the transfer becomes the parameter JSON object string interception, JS converted object to a string, it is determined whether the variable is undefined

1, an array of printing the acquired name:
for (var I in MSG) {
the console.log ( 'I:', I);
}
2, the transmission parameters become JSON objects
var newdate = [ "2019-12-08 "];
NewDate the JSON.stringify = (NewDate);
. 3, string interception
testTime testTime.substring = (0,. 3-testTime.length);
. 4, the JSON.stringify () method to convert a string JavaScript object.
B = {var "cmd": "2", "Data": "3-20191213163034-3496"};
B = the JSON.stringify (B)
the JSON.parse () method to convert the data to a JavaScript object.
5, it is determined whether the variable is undefined
IF (typeof (Qlong) == "undefined") {
Qlong = qi.length;
}

Published 11 original articles · won praise 0 · Views 29

Guess you like

Origin blog.csdn.net/qq_25787687/article/details/105145188