Hacker News new | past | comments | ask | show | jobs | submit login

For the array zip one @14:20, I'm surprised he didn't briefly mention that you can use unpacking in the block parameters:

    names = ['fred', 'bill']
    ages = [33, 40]
    locations = ['san francisco', 'dubai']
    
    names.zip(ages, locations) do |n, a, l|
      puts n
      puts "lives in " + l
      puts "is #{a} years old"
    end



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: