Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4619

when bsearch matches first element in array with 2 values it returns nil. Why?

$
0
0

I don't understand why bsearch method returns nil, when array has 2 values.

arr = [1, 2]arr.bsearch { |el| el < 2 }

Viewing all articles
Browse latest Browse all 4619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>