Recovering interrupter with occasional relapses, lover of spreadsheets, blogger, programmer, adept debugger, conjurer of analogies, and probably other things.
The * and ** are some of my favorite features; especially when you consider that if you have a hash with keys that are symbols you can prepend the ** and pass those as keyword args:
Recovering interrupter with occasional relapses, lover of spreadsheets, blogger, programmer, adept debugger, conjurer of analogies, and probably other things.
Welcome to the learning!
The
*
and**
are some of my favorite features; especially when you consider that if you have a hash with keys that are symbols you can prepend the**
and pass those as keyword args:Which gets super cool when you have the case where
params
has more keys/values (e.g.params = { hello: "world", gummy: "bears", ninja: "turtle" }
)You can then do the following:
The above will only pass the
:hello
and:gummy
values as named arguments.The
**
is a common pattern I use for dependency injection.This is definitely one of those operators you learn about and then suddenly realise how much easier it makes life.
Yes, and I'm excited to see where this learning takes you.