2 ms·
There are 2 forms of range in ruby: inclusive 2 dots - 1..5 => 1, 2, 3, 4, 5 and exclusive 3 dots 1...5 => 1, 2, 3, 4 It's always felt deeply counter-intuitive
by bhrgunatha 8y ago
There are 2 forms of range in ruby: inclusive 2 dots - 1..5 => 1, 2, 3, 4, 5 and exclusive 3 dots 1...5 => 1, 2, 3, 4
It's always felt deeply counter-intuitive to me because .. feels like it represents less than ... but that's a separate discussion.