📜  减去两个数组 javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:04.194000             🧑  作者: Mango

代码示例3
var array1 = [1,2,3,4,5,6.25];
var array2 = [9,8,7,6,5,4];

const diffNumber = (arr1, arr2) => arr1.map(function (num, idx) { return num- arr2[idx] });

diffNumber(array2, array1); //[8, 6, 4, 2, 0, -2.25]