January 2020
Intermediate to advanced
532 pages
13h 31m
English
It is quite simple to construct expressions from a quote block. But what if we want to dynamically create expressions? This can be done using interpolation, which allows us to insert variable values into the expression object with an easy syntax. Interpolation in an expression is very similar to the way that variables can be interpolated in a string. The following screenshot shows an example:

As expected, the value of 2 is correctly substituted in the expression. Note that splatting is also supported, as shown below:
We must make sure that the variable that includes the splatting operator is interpolated ...
Read now
Unlock full access