b = a.push nil

Walter

On May 24, 2013, at 9:56 AM, Love U Ruby wrote:

> a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> b = a + [nil]
> p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
> p b #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, nil]
> 
> Is there any other Rubyist way to get the `b` array from `a` array?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/2da174969111a227ea087d4b8798a1a3%40ruby-forum.com?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/04B8F6E4-96C9-4101-96A3-6F239B074F87%40wdstudio.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to