1
00:00:00,090 --> 00:00:00,600
Welcome back.

2
00:00:00,630 --> 00:00:02,070
How's your calculator coming?

3
00:00:02,520 --> 00:00:07,890
We noticed that we've got most of the functionality that we need, it is up and working and we're still

4
00:00:07,890 --> 00:00:10,590
missing some functionality on a few of the key keys.

5
00:00:10,800 --> 00:00:16,470
So that one being the equals sign that it adds, that equals sign in there and as well as the C, which

6
00:00:16,470 --> 00:00:19,280
is not exactly supposed to actually clear it out.

7
00:00:19,590 --> 00:00:22,290
So we have to actually look for those separately.

8
00:00:22,530 --> 00:00:28,950
So we see that if the my value is an equal sign that, well, all we need to do is actually do the evaluation.

9
00:00:28,950 --> 00:00:31,080
We don't want to do anything outside of there.

10
00:00:31,380 --> 00:00:39,180
So let's take a look and we're going to see if the my value so do a condition if my value is equal to

11
00:00:39,180 --> 00:00:41,090
and that's the equal sign that we're looking for.

12
00:00:41,970 --> 00:00:47,880
And then the rest we can do else here so this else stuff can get added in afterwards.

13
00:00:48,540 --> 00:00:53,130
So we take our my value with the equal sign.

14
00:00:53,140 --> 00:00:54,510
We're not adding anything.

15
00:00:54,570 --> 00:00:58,500
All we're doing is we're doing the evaluation that's going to update the text.

16
00:00:58,510 --> 00:01:05,310
So three plus three and we do equal it will move it into six so it doesn't add anything into the string.

17
00:01:05,310 --> 00:01:09,570
And we don't actually want that equal sign to add anything into the string itself.

18
00:01:10,230 --> 00:01:15,440
So see that that works nice and neatly and gives us the ability to utilize the equal sign.

19
00:01:15,750 --> 00:01:22,800
So other thing that we need to do as well is we need to add some type of function for the C, so if

20
00:01:23,040 --> 00:01:28,530
that is a C, then what we want to do is clear out that value.

21
00:01:28,770 --> 00:01:35,010
So we're going to take a look and we're going to see if my value is an equal sign or if it's equal to

22
00:01:35,010 --> 00:01:39,000
a C, or we can have another separate condition for that as well.

23
00:01:39,270 --> 00:01:41,970
So checking to see if it's equal to that.

24
00:01:42,300 --> 00:01:50,400
And over here, let's do a quick check to see if my value is equal to C, and if it is, then we know

25
00:01:50,400 --> 00:01:53,670
that this is what this is a function that we need to run here.

26
00:01:53,970 --> 00:01:57,510
And the C is to clear the miscalculation calculation.

27
00:01:58,050 --> 00:02:02,370
So taking the miscalculation, we don't want to do any evaluation or anything like that.

28
00:02:02,610 --> 00:02:09,350
We're taking the my calculation and we're setting my calculation to a value of zero.

29
00:02:09,360 --> 00:02:09,810
So it's a.

30
00:02:10,680 --> 00:02:16,310
And we could actually do this near the end, so it doesn't interfere with any of our calculations.

31
00:02:16,320 --> 00:02:21,060
So even if we've got a bunch of other values there, we're adding it in by default.

32
00:02:21,060 --> 00:02:24,440
If we had clear always, it brings it back down to zero.

33
00:02:25,290 --> 00:02:32,100
So we go we've got our fully functional calculator all built with JavaScript and as dynamically as possible,

34
00:02:32,610 --> 00:02:35,850
all the calculations works and you can try it for yourself.

35
00:02:36,180 --> 00:02:41,400
So go ahead and add in these last two conditions to fix the calculator functionality.

36
00:02:41,700 --> 00:02:47,430
And coming up next, we'll do a quick code review of all of the functions and all of the code that we've

37
00:02:47,430 --> 00:02:49,440
run through and built out to build this calculator.

38
00:02:49,590 --> 00:02:50,790
So that's all coming up next.
