Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json into array


function list() {
  return Array.prototype.slice.call(arguments)
}

let list1 = list({0:"zero"}, {1:"one"}, {2:"two"}) //[ { '0': 'zero' }, { '1': 'one' }, { '2': 'two' } ]
console.log(list1);



let list2 = list({0:{z:"zero"}, 1:{o:"one"}});
console.log(list2) //[ { '0': { z: 'zero' }, '1': { o: 'one' } } ]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #json #array
ADD COMMENT
Topic
Name
6+4 =