Hi,
I want to multiply two arrays, element by element:
[1,2,3] * [4,5,6] = [4,10,18]
I am new to JS, I just have no clue... This is the furthest I got:
Code:var array1 = [1,2,3]
var array2 = [4,5,6]
function multiply() {
var mult = array1.pop()*array2.pop()
post("mult",mult)
post()
}
So, every time I execute multiply it multiplies the next two elements of each array. But not all at once, creating a new array.
Thanks,
PS