How can I run through three separate arrays in the same for loop?

前端 未结 6 1309
遇见更好的自我
遇见更好的自我 2020-12-06 13:38

I have three arrays I am trying to run through and I want to use the values from all three arrays in one function. This might sound confusing but here is what I have:

<
6条回答
  •  佛祖请我去吃肉
    2020-12-06 14:31

    See below. However, your code will crash if any of these arrays differs in size from the others.

    var Name = ["a", "b", "c"]
    var Age = [1, 2, 3]
    var Gender = ["m", "f", "m"]
    
    for (var i = 0; i

提交回复
热议问题