What does '**' in Ruby do? -


what ** symbol mean in ruby?

(1..5).map { |i| i**2 } # => [1, 4, 9, 16, 25] 

fixnum#** exponent operator. in example, squaring i (raising power of 2).


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -