Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Get JSON Values In Array Alternative Syntax

var j = {a:"aaaaa", b:"bbbbbb", c:"ccccccc"}
var x = [];
for(key in  j)
{
x.push(j[key]);
}
 
console.log(x); 
/*note that for of does NOT work for this case*/
/*Note we do not need to know the numbers of keys/values ahead of time*/
 
PREVIOUS NEXT
Tagged: #Get #JSON #Values #In #Array #Alternative #Syntax
ADD COMMENT
Topic
Name
5+3 =