Skip to content

Instantly share code, notes, and snippets.

@moshiurse
Created January 5, 2020 08:49
Show Gist options
  • Save moshiurse/b6cceded311837eb2c95aab3f9c6aa9a to your computer and use it in GitHub Desktop.
Save moshiurse/b6cceded311837eb2c95aab3f9c6aa9a to your computer and use it in GitHub Desktop.
Add Data to multidimensional array
for (var i = 0; i < rows.length; i++) {
item_id[i] = rows[i].book_id;
item_name[i] = rows[i].bookname;
item_quantity[i] = rows[i].item_quantity;
item_rate[i] = rows[i].item_rate;
item_price[i] = rows[i].itemcost;
strickerArray.push({'id': item_id[i], 'name': item_name[i], 'price': item_rate[i]});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment