js for循环的写法
1.
let productLevelList = [];
goods.forEach( item => {
ownerNoList.push(item.ownerNo);
productLevelList.push(item.productLevel);
})
2.
for (var i = 0; i < arr.length; i++) {
var arr2 = arr[i].split(’=’)
if (arr2[0] === key) {
return arr2[1]
}
}
3.
let packageList = [];
for (let lb of listLabel) {
let p = {};
p.length= lb.length;
p.length = 0;
packageList.push§;
}
4.
for (property in obj) {
console.log(property, obj[property]);
}