Solution Review: Tagged Template
Let’s discuss the solution to the tagged template challenge given in the previous lesson.
We'll cover the following...
We'll cover the following...
Solution
We will review the following solution step-by-step.
Explanation
There are two main functionalities that tag stripMargin has to implement to get the desired output.
- Convert all expressions to upper case
- Remove all leading spaces and indentations on the new lines
So, let’s start with the first one.
Converting expressions
In the function definition at line 3, we are taking two parameters:
textsexpressions
expressions
The ...