Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Tushar Jadhav

for(var i = 0; i < fruits.length; i++) {
    var obj = {}; // <---- Move declaration inside loop

    obj['data'] = fruits[i];
    obj['label'] = label;
    arr.push(obj);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Tushar #Jadhav
ADD COMMENT
Topic
Name
4+2 =