JavaScript,子数组中怎么样拆分字母和数字?
JavaScript,子数组中怎么样拆分字母和数字?
日期:2019-10-16 08:55:48 人气:1
因为,这个数组中的元素是对象,要获取对象的属性值的方法是Object.属性名
function totalAmount(array, fieldName) {
let total = 0;
for (var i = 0; i < array.length; i++) {
total += parseInt(array[i][fieldName]);
}
return total;
}
console.log("The total amount of all transa