How to populate an array in ruby?

Discussion in 'Ruby' started by Mark Milke, Jul 11, 2011.

  1. Mark Milke

    Mark Milke Guest

    Hello there,

    having an array like this one my_arr = [0..2] what is the best way to
    populate it with values?
    Can the my_arr.each do be use for this purpose and if yes how?

    Mark Milke, Jul 11, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.