String Interpolation With Quoted Strings
Stapling strings together with the ++
operator can be tedious and clunky. If you have string variables that you'd like to interpolate, you can piece them together much more easily using quoted strings.
We can get close to a solution with the standard quoted string syntax.
This isn't quite right though. We have to take advantage of a preprocessing hook provided by Bucklescript. The j
hook supports unicode and allows variable interpolation.
To use this pre-processor we have to include j
in the quoted string like so {j|...|j}
.
See a live example here.
Last updated