107
rated 0 times
[
113]
[
6]
/ answers: 1 / hits: 23988
/ 9 Years ago, tue, january 12, 2016, 12:00:00
I have an array whose elements are also arrays, each containing three elements. I want to call the function calcMe(a,b,c){...}
for each of the elements of my main array using forEach()
method, but I got really confused and don't know how to get it to work.
arr = [[1,5,4], [8,5,4], [3,4,5], [1,2,3]]
function calcMe(a,b,c){...}
arr.forEach(calcMe.Apply(-----, -----));
How do I pass each of the inner array's elements as arguments to my function using Apply()
?
More From » arrays