Hi guys can someone please help me with some code, so i have two arrays a and b i want to divide a by b. Here is my arrays var a = [ "14", "8", "3", "5" ];
Var b = [ "44", "16", "30", "11" ];
So i want my result to be an array. Please can someone help me
答案 0 :(得分:0)
You can use Array.map
for this
var a = [ "14", "8", "3", "5" ];
var b = [ "44", "16", "30", "11" ];
let res = a.map((d, i) => d/b[i])
console.log(res)