var price = [], id = []; for (var i = 0; i < material.length; i++) { price.push(material[i].price); id.push(material[i].id); }