RubyFlow The Ruby and Rails community linklog

TIL - Ruby Array Multiplication

Today I learned that if you call a multiplication operator on a Ruby array, it duplicates each element of the array by the multiplier. Not sure what the use case would be. For fun, I created an exponent operator for array as well, using this functionality.

Read more on my blog

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in