<p>Is there any Ruby equivalent for Python's builtin <code>zip</code> function? If not, what is a concise way of doing the same thing?</p>

<p>A bit of context: this came up when I was trying to find a clean way of doing a check involving two arrays. If I had <code>zip</code>, I could have written something like:</p>

<pre><code>zip(a, b).all? {|pair| pair[0] === pair[1]}
</code></pre>

<p>I'd also accept a clean way of doing this without anything resembling <code>zip</code> (where "clean" means "without an explicit loop").</p>

Ruby has a zip function:
```
```
[1,2].zip([3,4]) => [[1,3],[2,4]]
```
```
so your code example is actually:
```
```
a.zip(b).all? {|pair| pair[0] === pair[1]}
```
```
or perhaps more succinctly:
```
```
a.zip(b).all? {|a,b| a === b }
```
```