I want to call .map only on the first X elements of the array. How to do it?
In ruby 1.9
array.first(X).map{|e| ...}
Ruby 1.8
array[0, X].map{|e| ...}
Plain,
array.first(X-number)
and that's all.
See you...
Source: https://habr.com/ru/post/887588/More articles:https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/887583/providing-several-non-textual-files-to-a-single-map-in-hadoop-mapreduce&usg=ALkJrhgjjBbrAkfgBh0qHGff_3zko60hmgASP.NET 4.0 DropDownList with single quotes in text - encodingPass the map to a method requiring Map - javaUsing Facebook 2.0 Queries Using the C # SDK - facebookPython line break with regex - pythonAdd a sequence of numbers recursively - cCapybara + RSpec sees only blank pages in controller specifications. What for? - ruby | fooobar.comC # - determine if a range of IP addresses contains a specific address - stringset file permissions in setup.py file - pythonHow to listen to double click on jstree? - javascriptAll Articles