0

I have two javascript arrays that I'd like to iterate over simultaneously with a for/in loop. I know how to do this with a normal for loop for (i = 0; i > number; i++). If you're not familiar with python's zip() command, I have an example below.

a = [1,2]
b = [3,5]
for x,y in zip(a,b):
    print x+y

>>> 4
>>> 7
Austin A
  • 2,990
  • 6
  • 27
  • 42
  • @iCodez, please point to the question that I've duplicated. – Austin A Jan 25 '15 at 02:10
  • It's at the top of your question. Maybe you need to refresh the page? Either way, here's a link: http://stackoverflow.com/questions/4856717/javascript-equivalent-of-pythons-zip-function –  Jan 25 '15 at 02:11
  • Yea, I just saw it too. For some reason when it searched for it earlier this question didn't come up. I hate duplicators as much as you do. Sorry about that. – Austin A Jan 25 '15 at 02:12

0 Answers0