1 00:00:00,920 --> 00:00:02,270 Welcome back everybody. 2 00:00:02,270 --> 00:00:03,010 All right. 3 00:00:03,050 --> 00:00:07,030 So let's go ahead and let's do a little bit of math here. 4 00:00:07,040 --> 00:00:07,590 OK. 5 00:00:07,670 --> 00:00:14,130 So we can see that we changed the text to two but guess what we can do with this number here. 6 00:00:14,210 --> 00:00:16,950 OK we can add in plus 1. 7 00:00:17,210 --> 00:00:17,790 OK. 8 00:00:17,850 --> 00:00:20,630 And so what this will do is this will make it equal to three. 9 00:00:20,630 --> 00:00:25,380 Now let's just do a little bit of math and say two and then you'll equal four. 10 00:00:25,400 --> 00:00:30,530 So you can do a little bit of math here and I'm just going to squeeze this in here and don't worry about 11 00:00:30,530 --> 00:00:31,940 this because remember it doesn't change. 12 00:00:31,940 --> 00:00:35,600 I just want to focus in on the javascript for a moment here. 13 00:00:35,610 --> 00:00:41,060 OK let's add in another variable here and we can again remember we can add in as many variables as we 14 00:00:41,060 --> 00:00:41,420 want. 15 00:00:41,420 --> 00:00:43,550 We're going to call this number 16 00:00:46,100 --> 00:00:51,310 or we'll call it second number k for it and make it equal to 2. 17 00:00:51,530 --> 00:00:52,890 So they're both equal to two. 18 00:00:53,150 --> 00:01:00,000 And we can do variable number plus second number k. 19 00:01:00,140 --> 00:01:02,980 Now you'll also notice and move. 20 00:01:03,000 --> 00:01:04,410 So even a little bit more. 21 00:01:04,700 --> 00:01:09,190 If I double click on this you can see that it highlights it and everything works out like that. 22 00:01:09,500 --> 00:01:10,010 All right. 23 00:01:10,190 --> 00:01:15,940 So if you change the tax it equals to 4 pretty simple right now. 24 00:01:15,980 --> 00:01:22,030 Watch what happens if we type in variable name plus second number. 25 00:01:22,040 --> 00:01:27,440 Now in pretty much every other programming language this is going to cause some kind of error. 26 00:01:27,500 --> 00:01:30,360 And the reason why causes an error is another programming languages. 27 00:01:30,410 --> 00:01:36,530 What ends up happening is that you can add a number to a letter it just doesn't make sense. 28 00:01:36,530 --> 00:01:42,080 It's like you know if you're asked if you ask yourself how many apples do we have and you have we know 29 00:01:42,080 --> 00:01:47,630 one Apple plus an orange it's like one but it doesn't really make any sense to the computer. 30 00:01:47,630 --> 00:01:49,150 Watch what happens when we do this. 31 00:01:49,160 --> 00:01:49,680 OK. 32 00:01:49,730 --> 00:01:54,680 It says John plus two is just basically mashes everything together and then there's not really a better 33 00:01:54,950 --> 00:01:55,610 term for that. 34 00:01:55,610 --> 00:01:58,410 It just it just puts them together really that's all it does. 35 00:01:58,580 --> 00:01:59,080 OK. 36 00:01:59,240 --> 00:02:02,610 Now you'll also notice that there is no space for John. 37 00:02:02,630 --> 00:02:05,560 And the reason is is that there is no space here. 38 00:02:05,570 --> 00:02:12,440 Now remember in a couple of tutorials ago I said that space's is like adding another object and that's 39 00:02:12,500 --> 00:02:18,050 partly true except for when you have the quotes here if you have a quote here you can put in you know 40 00:02:18,770 --> 00:02:20,120 10 of these if you want. 41 00:02:20,120 --> 00:02:21,200 It doesn't matter. 42 00:02:21,200 --> 00:02:25,090 So we're going to go ahead space and you can see that says John too. 43 00:02:25,400 --> 00:02:26,060 OK. 44 00:02:26,060 --> 00:02:32,180 And of course let's just go ahead and let's just add another variable and we're going to call this second 45 00:02:32,360 --> 00:02:33,310 string. 46 00:02:33,440 --> 00:02:33,770 OK. 47 00:02:33,800 --> 00:02:40,470 It's going to be equal to two quotes and we're going to call this 48 00:02:43,470 --> 00:02:47,060 we'll just say John plus awesome. 49 00:02:47,080 --> 00:02:49,470 Ok put another space in there. 50 00:02:49,710 --> 00:02:52,980 And of course is one thing that's missing in that is a semi-colon. 51 00:02:53,030 --> 00:03:00,540 OK and of course we change second number to second string K and double click on that. 52 00:03:00,570 --> 00:03:01,710 It does work. 53 00:03:01,710 --> 00:03:02,520 And there we go. 54 00:03:02,640 --> 00:03:03,330 That's all it is. 55 00:03:03,330 --> 00:03:06,580 Now you can do this infinitely if you really want to write. 56 00:03:06,600 --> 00:03:08,340 You can go ahead and push plus 57 00:03:11,440 --> 00:03:16,140 variable number etc. you can do this as much as you want. 58 00:03:16,210 --> 00:03:19,090 Programming languages are meant to be like this. 59 00:03:19,270 --> 00:03:22,270 They're meant to be they're meant to be anything. 60 00:03:22,270 --> 00:03:30,010 Now of course if you go ahead and if we were to just do one more bit of math here I was going to go 61 00:03:30,010 --> 00:03:31,430 ahead and delete this here. 62 00:03:31,480 --> 00:03:35,170 You can do any kind of math you want to. 63 00:03:35,170 --> 00:03:42,640 So we have variable number minus 2 three and then we can go ahead it equals to negative 1. 64 00:03:42,670 --> 00:03:43,160 OK. 65 00:03:43,330 --> 00:03:46,270 That makes perfect sense you can do whatever you want. 66 00:03:46,360 --> 00:03:49,630 You can go times and there you go. 67 00:03:49,630 --> 00:03:50,090 OK. 68 00:03:50,200 --> 00:03:52,720 So that's essentially how you use variables. 69 00:03:52,720 --> 00:03:57,670 And that's one thing that was really good about javascript is that's not to throw you an error it's 70 00:03:57,670 --> 00:03:59,000 going to work out in some way. 71 00:03:59,140 --> 00:04:05,560 However I highly recommend that you separate your numbers and your your your strings in two different 72 00:04:06,100 --> 00:04:07,020 different categories. 73 00:04:07,020 --> 00:04:09,830 And that for the most part you don't really do. 74 00:04:09,970 --> 00:04:16,030 You don't really add them together like I did unless you're going ahead and doing that for display purposes. 75 00:04:16,030 --> 00:04:18,280 All right I'll see you guys in the Tauriel.