I'm doing the following:
array_variable = collection.map do |param|
some value with param
end
return array_variable.compact
Can I call map
and compact
in one statement somehow, so I can return the result instantly?
I'm thinking on something like this (it may be invalid, however):
array_variable = block_code param.compact
# block_code here is a method for example which fills the array