1
00:00:00,180 --> 00:00:05,160
We have a fully functional tip calculator, we wanted to add in one more thing in this lesson, and

2
00:00:05,160 --> 00:00:08,840
that's going to be setting this up using a template type format.

3
00:00:09,120 --> 00:00:13,400
So get rid of the single quotes and adding in tactics.

4
00:00:13,620 --> 00:00:18,230
The tactics are available above your tab and they look like this.

5
00:00:18,360 --> 00:00:23,880
And as you can see, it opens and closes and breaks out of the string value.

6
00:00:24,060 --> 00:00:27,450
And then we can also still use that same string format.

7
00:00:27,660 --> 00:00:31,570
But it's including all of that content that we had here within the dollar sign.

8
00:00:31,920 --> 00:00:38,670
So in order to break out of this dollar sign, we can use the dollar sign and we've got dollar sign,

9
00:00:38,670 --> 00:00:39,300
dollar sign.

10
00:00:39,540 --> 00:00:44,760
And then this is breaking out of that tic object where we're using the dollar sign.

11
00:00:44,880 --> 00:00:50,920
And within here is where we can add in the cost value or actually this would be the tip value.

12
00:00:50,970 --> 00:00:52,490
So just type in tip in here.

13
00:00:53,220 --> 00:00:55,050
So let's refresh and see what that looks like.

14
00:00:55,290 --> 00:01:00,200
So now we've got tip of fifteen dollars and typically you only need the one dollar sign.

15
00:01:00,210 --> 00:01:04,540
But because we are outputting values and money, that's what we've got the two dollar signs.

16
00:01:04,800 --> 00:01:10,050
So in order to get that object, it's dollar sign, curly bracket and then whatever the value of the

17
00:01:10,050 --> 00:01:10,830
variable is.

18
00:01:11,130 --> 00:01:17,040
So in this case, we're doing a dollar sign curly bracket and we're updating this cost value and to

19
00:01:17,040 --> 00:01:19,920
be contained right within there.

20
00:01:20,010 --> 00:01:27,000
And as you can see, that brackets actually output's them within those variable values instead of having

21
00:01:27,000 --> 00:01:29,960
it within the string value, which is orange within my interface.

22
00:01:30,300 --> 00:01:31,890
So let's try that one more time.

23
00:01:32,040 --> 00:01:34,660
You should tip 15 dollars on one hundred dollars.

24
00:01:34,980 --> 00:01:41,580
So this is a great way to make your code much neater and also gives you the ability to use single double

25
00:01:41,580 --> 00:01:45,410
quotes without having to use the box in order to break out of them.

26
00:01:45,720 --> 00:01:47,220
So I just show you how that works.

27
00:01:47,250 --> 00:01:48,810
So try that one more time.

28
00:01:48,810 --> 00:01:53,460
And now you can see that we've got the double quotes and the single quotes and we don't need to break

29
00:01:53,460 --> 00:01:53,880
out of it.

30
00:01:54,330 --> 00:01:57,930
The backslash break just simply adds a space there as well.

31
00:01:58,110 --> 00:01:59,940
So go ahead and try this out for yourself.

32
00:02:00,040 --> 00:02:05,130
Get comfortable with using the tactics and the templating format for JavaScript.
