Rails 6 adds Array extract!
27-Jun-2019 1828
This blog is part of our Rails 6 series. Rails 6.0.0.rc1 was recently released.Rails 6 added extract! on Array class. extract! removes and returns the elements for which the given block returns true.extract! is different from reject! in the way that reject! returns the array after removing the elements whereas extract! returns removed elements from the array.Let’s checkout how it works.
Rails 6 adds Array extract! #ruby #rubydeveloper #rubyonrails #Rails #Array #extract! #array https://www.rubyonrails.ba/link/rails-6-adds-array-extract