I stumbled upon strange behavior while playing with the ranges expected:
(1...1).count # => 0 (1...1).first(1) # => [] (1...1).last(1) # => [] (1...1).to_a # => []
but
(1...1).first # => 1 (1...1).last # => 1
Am I missing something or is this intentional behavior?
The reason is that it Range#firstis defined as return Range#beginif the argument is not passed .
Range#first
Range#begin
Similarly - => . Range#lastRange#end
Range#last
Range#end
Source: https://habr.com/ru/post/1609622/More articles:How to get unique values from two dictionary lists using Linq? - dictionaryVerifying system architecture in Inno Setup - crystal-reportsBackground color ios-charts - swiftSimple templates with time stamps - ansibleHow to return an element index with the probability of an element value divided by the sum of an array - arrayshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1609623/mvc-6-cannot-pass-multiple-json-parameters-to-a-controller-anymore&usg=ALkJrhgKZMgT3XNuy0WpKnA_lu5V3csNUgSwipeListener in ListView and ClickListener in ListView items - androidHow to check 64/32-bit in Inno setup - inno-setupДинамически выбирать класс из строки - "MyClassName" → MyClassName - javascriptSite Does Not Detect Index - .htaccessAll Articles