We have a fully functional tip calculator, we wanted to add in one more thing in this lesson, and
that's going to be setting this up using a template type format.
So get rid of the single quotes and adding in tactics.
The tactics are available above your tab and they look like this.
And as you can see, it opens and closes and breaks out of the string value.
And then we can also still use that same string format.
But it's including all of that content that we had here within the dollar sign.
So in order to break out of this dollar sign, we can use the dollar sign and we've got dollar sign,
dollar sign.
And then this is breaking out of that tic object where we're using the dollar sign.
And within here is where we can add in the cost value or actually this would be the tip value.
So just type in tip in here.
So let's refresh and see what that looks like.
So now we've got tip of fifteen dollars and typically you only need the one dollar sign.
But because we are outputting values and money, that's what we've got the two dollar signs.
So in order to get that object, it's dollar sign, curly bracket and then whatever the value of the
variable is.
So in this case, we're doing a dollar sign curly bracket and we're updating this cost value and to
be contained right within there.
And as you can see, that brackets actually output's them within those variable values instead of having
it within the string value, which is orange within my interface.
So let's try that one more time.
You should tip 15 dollars on one hundred dollars.
So this is a great way to make your code much neater and also gives you the ability to use single double
quotes without having to use the box in order to break out of them.
So I just show you how that works.
So try that one more time.
And now you can see that we've got the double quotes and the single quotes and we don't need to break
out of it.
The backslash break just simply adds a space there as well.
So go ahead and try this out for yourself.
Get comfortable with using the tactics and the templating format for JavaScript.