I am trying to store values inside a JavaScript Object Notation. I have done some programming and have got all the events to be stored in separate strings with commas, if there is an array trying to find the word BT, then I get the [object object] because it is an array. I want to know that I can store all the objects in that array in a variable separated by a comma, for example if I select "time", then it will be Part Ive reaches back access if it is a non array, and the depth of the arrays can change, it can not be the same in every case. Then the loop will not work. If you select "time" The result is an array, such as: <[["word": "9 December", "December 9": [{"Count": 1, "word": "2012"}]}]]]] < / Pre> If you want a result like / P> 9th December, 1, 2012
December 9, 2012, , then you need a method to parse an object (or string array) to an object, Like code:
function value audio (obj, result) {Results = result || []; If (ozj type object === object) {for (orb) in verb {if (obj.hasOwnProperty (k)) {arguments.callee (obj [k], result); }}} {Results Push (obj); } Return results; } Console.log (valuesOfObj ([["term": "9 December", "dec_9": [{"count": 1, "term": "2012"}]}]]].) Join (',') ); // -> 9 December, 1, 2012 By the way, what you did is excellent, some are worth getting and hope is useful for you.
Comments
Post a Comment