How to loop multiple array values
<p>I have arrays:</p>

<pre><code>array1 = ['abc1.1', 'def2.2', 'fgh3.3']
array2 = ['/a/b/c', '/d/e/f', '/f/g/h']
</code></pre>

<p>I'm expecting to print as below:</p>

<pre><code>abc1.1
/a/b/c
def2.2
/d/e/f
fgh3.3
/f/g/h
</code></pre>

<p>I'm not sure how to get the expected output. Please suggest.</p>

<p>My attempt is as below:</p>

<pre><code>array1.each do |x|
  puts "#{x}"
  array2.each do |y|
    puts "#{y}"
  end
end
</code></pre>

<p>And it results as below:</p>

<pre><code>abc1.1
/a/b/c
/d/e/f
/f/g/h
cde2.2
/a/b/c
/d/e/f
/f/g/h
fgh3.3
/a/b/c
/d/e/f
/f/g/h
</code></pre>

<p>During every iteration of <code>array1</code>, it completely iterates the <code>array2</code>, then goes back to <code>array1</code>.</p>