 All right, hoping that everything's good. We're gonna start with you today, so let me get you started. I'm Susan Hoyt, I'm here in Houston, Texas. I've been teaching computer science and coding for about 25 years now. I have been with Sailor about a year now. I do love each coding. It's great to see people just see a whole new world open up and really go along with it and get some great opportunities out of it. As a person, I hang out with my dogs, read a good book, sit on a beach and I'm good to go. All right, so what course are we talking about? We're talking about the JavaScript one course and the link is there, like you said. There's this course, unit three we're looking at. So we've already done unit one and two and unit three is values, variables and statements. We'll also be continuing and doing four, five and six, everyone on Tuesday and we'll let you know those dates and times just to let you know. So here we go. What do we do last week? Last week we covered unit two and tried a JavaScript. So we went through a whole bunch of JavaScript basics. We talked about different things you could use to type your JavaScript in, stuff like that. We did a live also there if you wanna look at it and make sure you try to work through it for the course because you really wanna try to keep up with us if you're trying to do it so that way you are in the same spot that we are for this course. How are you going to get through this course and get certificates? You must score a 70 or above on that course final exam to get that certificate. You can retake the exam as many times as you need to get that 70, but each time you take it and you don't get that 70, you've got to wait until you can take it. We also discussed using Code Runner, which I'm gonna show you again today. It will be in the assessment and it's where you're gonna type in the code to actually answer questions one or two a lot of the times on the test. We also used developer tools last week and ran some code examples on those and did a little bit with that stuff. So it was a lot of introduction. Of course it was called Intro to JavaScript. So a lot of introductory stuff. All right, so what are we talking about unit three? If you start to look at unit three and you started to look through it, it looks like there's a ton of stuff. So I've tried to make it a little bit shorter and pick out some of the more important things. There's just a lot of stuff to JavaScript when you're talking variables, operators and key words. There's just a ton in the different values, the data types, the operator, all the JavaScript experiments and the syntax. It's just a lot of stuff together. So I would highly suggest that as you're working through this, you take your time. You might wanna take notes. Like I said, there's a lot of stuff. There's a lot of reading. In between the reading stuff, I would always go and try it, get out your IDE or whatever you're gonna use and practice what they're showing you just so that we can do it without having to just watch it. Let's move on. All right, so we're gonna start with data types and values. This is our intro to this part. All right, so JavaScript has what's called primitive and object types. Primitive types are immutable where a lot of people haven't heard from. It's immutable means that it can't change. So when I say that a type is immutable, I don't mean that once you say that my name equals Bob, that you could never change that. You can change the variable that holds a, you can assign it another value. You just won't actually change that original value. Like if I said my name equals Bob, I could later on say my name equals Sally, but I didn't add Bob's value. I just changed and assigned it another value. So it makes sense because I know immutable and mutables always something that my students are like, wait, what do you mean it can't just change? So hopefully that'll help you type some cells, which we're not really going to touch into this, but it's in general for you to know as you're talking about it, their values can change once you create them. JavaScript is dynamically type language, which means I don't have to define the type of a variable in a program, but that's really not the best practice to do. All right, what are some kind of primitive types that we can talk today? Numbers, strings, Boolean, those are three that we will touch on, especially the numbers and strings today. Object types, you've got arrays, objects and functions. These I will briefly maybe show you an example, but these are going to be covered more so later on in the course, okay? All right, so as you're talking about numbers, you're being cold numbers, which are your integers, absolutely no decimal places or points, sorry. Fractional number, those are going to be your real numbers and those are going to be your ones that have your floating point. Then we have scientific notation. So if you have a really big or really small, you may remember back like in scientific notation, you did this 2.998 times 10 to the eighth, that should have been a power up there. I don't know what happened on slide, but that should have been to eight power. Instead of doing this times 10, JavaScript has no idea what that part means. Put a E here, E represents our times 10 to the eighth. All right, mathematical operators. Like I said, there's a lot of content in here. You may need to make notes, you may want to just like take your time, you know, leave the computer for a minute and come back because you will have a lot of content. So mathematical operators, same ones we know forever, plus, minus, division, multiplication, and then you see this one. Go, hold on, are we doing percentages? No, this is a special math operator that we are going to use to do modulus, which is going to be remainder division and I'll show you a little bit more about that in a second. Order of operations, same as math, PEMDOS is what my students time, they say PEMDOS, I'm old enough that remember it as, please excuse my dear Aunt Sally, which they laugh at me when I say that, but it's the same thing, your parentheses always go first, your exponents, multiplication and division are on the same level, and then of course you've got your plus and your minus, which I did not put on that slide. All right, so if you're ever in doubt, add parenthesis, you know that that will happen and if you put it through, you know your order one is going to happen. So this percentage, this percentage is not the percent of a number. So if I say X percent Y, it doesn't mean, take the percentage I is of X or anything like that, it will give you the remainder of X by Y. If I took 144 divided by 12, I would get 12. Okay, that would be my result. But if I took 144 modulus 12, I would get zero because there's no remainder when I divide 144. So modulus is always going to be the remainder. Modulus has used a lot to see, is this number divisible by another number? And one of the biggest things that will see it used whenever you're doing so, yes. Sorry to cut you off real quick. Right there when you were doing the example of the module, you kind of cut out a little bit, I couldn't quite hear you, so maybe we could just jump back to that real quick. Okay, so where was I at? The example module, yeah. Okay, okay. The second call. Yeah, my internet keeps saying it's unstable and I'm sorry if that's, I don't want to do anything right now, I don't want to lose y'all. It's gotten a little bit, but I'm trying to keep an eye on it, I'll let you know. Okay, yeah, let me know because I see it up here and I could switch to my phone, but I just don't mess up our, let me know if I need to. No worries. Okay, okay, thanks. All right, sorry about that. I don't know what's going on with the internet right now. Okay, the percentage sign. It's modulus, so what is our example of it? Hey, if I took one, I did by 12, I would get 12. Great, 12 times 12 is 144, but if I took 144 and I did modulus 12, I'm going remainder of that. 144 divided by 12 gives me a remainder of zero. So this is always the remainder and this is just your regular division. Modulus is used a lot to see if a number is divisible by another number. So is something divisible by 12, I would do mod 12 and if I got zero for a remainder, then yes, it's divisible. X minus two, if that's equal to zero, that tells me, oh wow, that's an even number. If a number minus two is not zero, then it's an even number. So a lot of times you see modulus used in this way. All right, so special numbers that you really don't use, I don't really know of a good example to tell you, but you do see them talked about, is infinity and negative infinity? They represent something, yes, they do. And are they really infinity? No, because a computer isn't, it's a finite object. So no, they're not really infinity, but they are represented in JavaScript. Should you play around with them and use them a lot? Not because as you start to do stuff with them, you're going to end up right here where it is not a number. So when you, to a point that you divide by zero, you, that says NAN is error and that means it's not a number. You divide zero, so that is considered not a number. Okay, strings are used to represent text and you enclose them in quotes. So as I look here, you're going, okay, wait, these are quotes, these are quotes, and those are quotes, and guess what? All strings, look at all three of these in an example and look at some other stuff that I'm showing you right now, an example. My internet connection on stable came up again. Okay, what we want to talk about is escape sequences also, because if I'm trying to display quotes, but my string enclosed in a quote, I need to have a way to do that. So you will use backslashes. So if I went backslash N inside a string that says, as I go left to right, I see backslash. The backslash says, okay, look to the right of you and it says N. Those are kind of connected together. That means go to a new line. So this is a hit enter new line inside a ring. So I will do this example for you, show you how it looks. If I wanted to display a backslash, then I would have to put two backslashes and notice what it would display would be one backslash, my forward slash, it's just normal. I don't have to put two of anything. If I wanted to have a quote, I would have to go backslash quote, backslash quotes. And so we'll look at some of these in a little bit and play around with them. I'm gonna do a couple of slides and then we're gonna go around with them. The plus operator works on strings also, but not in the same way that it does with numbers. So it concatenates things or glues them together. So if I had these and these are all strings and notice I used double quotes on these, I could use single quotes, it's still gonna work. These will take all these letters and just glue them together. So it will actually glue it together and it'll look like this whenever I print it out. Strings that use the back ticks. Okay, so you go, okay, wait, what's a back tick? Well, my back tick is underneath the, I'm not sure if that's on everyone, but the back tick is there, I promise. It's right by the tilde. So whenever you use these, it's kind of cool because you can do this and then you see how I kind of have something in here for you. And so by doing these back to actually let it execute this, and instead of writing it just like that, it actually writes out. So that's kind of a cool thing was strings. Now we are gonna go over to strings and I'm gonna come over here and we're gonna go, I don't know if you remember this, but we went to more tools and we went to developer tools. So there, and you can see right here, I have my cursor just sitting there waiting for me. So if I were to do some string things, let me get those ready to go. I'm gonna do, whoops, let's do var my name, say, var my name equals, okay. And then if you notice, if I did my name, it says that my name, it's printed it with the single quotes, but that's okay. Now we're gonna talk in a minute because also can do this. Okay. Do you want me to try to get on my phone with this? I think if we get cut out, let me check something on the back end while I do that. Okay, okay. There's no word we'll lose. Oh, that's very true. That's very true. Okay. All right. We'll see. We'll see, we'll just play. Okay. All right, let's do this again. Okay, so I just did something like my name equals hoi. That was what I had typed. And so if I wanted to know what my name held, then my name held hoi. Great, that's, now I could also do this. My other, let's do other name. Okay, so let's say I did that. Whoops, if I could type, it'd be great. So then my other name, if I hit enter, it has that in it. Now I'm sure you probably noticed that on one of these I did var and one I did let. Right now we're not gonna talk about what the difference is between those, but I promise you I'm gonna come back to that and we're gonna talk about when I use them and which one should I use. Because as you go through this course, you'll see there will be some examples that have var and then some that have let. Want you to make sure you understand about it and how it works. But for right now, if I were to do, let's do that. Let's say if I were gonna take my name and I'm gonna take, I think I'm gonna go to uppercase. Okay, so do you see how my name all in caps? Great. So now I'm gonna do my name again, but hold on. I said my name too, great, it did that. But now when I do my name again, it's still what it was from the beginning. So when I told you, you can't actually do it unless you reassign it to something. I said my name to uppercase, JavaScript did its magic and it took my name and it changed it all to uppercase. But we did it in like a temporary location, it didn't change my name. So if I wanted to change it, I would have to do something like this. Okay, now, now my name again. Now it changed it. So doing this doesn't actually change my name and what it's assigned to unless I reassign it to something. So I have to reassign it in order for it to get new views, okay? Let's go back over here for a second. Whoops, didn't want to go there. Also too, whenever we're doing this, we wanted to look at these three different types of strings. And we have, whoa, and we have strings I'm gonna show you but I'm gonna do this in replet in a second and I'm gonna do this part in replet and we're gonna look at how they all look. So we're gonna look at all those and then we'll also do these in replet just because I wanna show you how replet works with everything. So let's go here and let's go to replet. I'm already logged in because I have my free account and I'm gonna create. Now on this one, I like to use their node. Yes, I choose that one. Again, it gives you weird names here and I don't just keep the weird name. Okay, so now here we are. So if I wanted to do something here, I could say, oops, I didn't need to reflect. So I'm gonna say my name. Okay, great. I'm gonna say let's, I'm gonna call my name too. Let's do that. And let's do my name three. Okay, now I'm gonna use the back tick. See how they kind of lean back. And okay, I've created all those. If I run it right now, it didn't get any errors. Nothing came out of it. I didn't tell it to do anything. So let's print if they all look different. So I'm gonna print my name and then I'm gonna do my name too. But I could spell and I'm gonna do my name three. All right, so now let's run and see. We've used all the three different things. Double quotes, single quotes, and then the back tick. So let's see what happens. And if you notice every single string is exactly the same. There's nothing changed, nothing different. So all those represent strings. Now, again, if I wanted to do what we did over there and I wanted to change my name to uppercut, so I'm gonna do it again. And then if I do const full, my name again, so let's do it. Okay, my name didn't change, okay? But if I reassign it and I change its assignment to something different, now you will see that it changed, okay? That's a huge thing to understand with the strings. Now, as you look over here too, we also talked about, also talked about using these. So backslash in is a new line. Two backslashes will just say one backslash and that will be a quote. So let's go back over here and I'm going to do console. All right, I'm gonna do a string and I'm gonna put a backslash here and watch what happens with this. So you see it did, this is A and then once it saw this backslash, it found its match and it said, oh, that in, that in means for me to go to the next line. So it went to the next line. Notice there's a space here because there's a space between these. If I had done it like this, then the S should be like this block, okay? So it makes a difference that way. All right, so let's try another one with a quote in the middle. I can have more than one backslash in here. Let's see what happens with that. And you'll see the quote showed up right there, okay? And let's say I wanted to have two backslash. I want one backslash to show up, so I have to put two, I'm gonna say that right. And so see one showed up over here even though I had two over there. A lot of times the pictures, the ASCII art pictures, they'll have you on the backslashes and it gets kind of weird because you have to do two for each one, but it's what they use for ASCII art. All right, so we did all. So we're good on all that. We have to come here. We want to talk about concatenating. And then I want to do this. I'm gonna grab it here and see if I can bring it over there without issues. Always be careful when you're copying and pasting stuff. Never know when you're gonna have issues. All right, so let's see. I'm going to leave it like that for right now in a row. Okay, so this is a string with a new line. That happened, but it didn't. All right, so let's not copy it from over there. I'm gonna try something else. And I'm gonna show you what in a second. Okay, and let me look simple. Okay, it's still not noticing it at all. So let's retype it. So if you have issues like that, so we're gonna type half of 100 is. So come back over here. And after we do that, we come back and we say what are we gonna do after that? Dollar sign and then our curly braces for that little block, curly braces there. All right, everything right. We got it back to half of 100 is and we got our dollar symbol, 100 divided by two. And then we have our other one to end it. And let's see what happens now. What did I forget to do? Hello, that's what I forgot to do. Hello. Okay, so that half of 100 is 50. Now watch if I take this and I put these quotes instead of the back ticks. It doesn't quite the same. So notice what the back ticks prints out exactly what's in those quotes. So if I wanted to run something like that then I've got to use the back ticks and it keeps putting two and one for me. So hold on in order to make it happen. And get your semicolons. And then again, it does all that for me. All right, let's do a quick concatenation and then we can move on. Okay, I'm gonna do this. I'm gonna put that there right now. I haven't created that yet but I'm gonna create it right here. I'm gonna say let my word equal and I'm gonna do hello and then I'm gonna do a plus and I'm gonna put there and I'm gonna do how. I'm not gonna write how are you because I don't click right and all that but we've got my word to add it all together. So let's see what happened. Okay, so hello there, how? Now notice that it basically does exactly what we said where it glues it together but we needed some spaces. We're gonna have to put them in ourselves. Okay, so we'd have to check, see if that's kind of how we want it spaced out. Looks good to me so we could leave it like that. All right, did we cover all of our stuff? Yes, so now we wanna talk about this. This is nice thing where it says, hey, you're using like a string and a number here. Let me try to figure out what data you want and I'll go ahead and fix it which sometimes that's great. It's great to have, it's great to use but we're gonna try some of these over here. So I'm gonna do some console.logs. Let's get rid of all these and we're gonna start with, oops, eight times null. Now notice null shows up, it's a reserved word already has some meaning to it. So when I do that, it says zero, okay. So great, how about this? How about when I have a string and a number minus sign? All right, so let's go try to do a string and minus one and let's see what happens. Okay, so a string minus one was that. Okay, what if the string was like this though? Instead of the number, what if I did the letter five? Here's a lovely thing I told you about, it's not a number, it says. So that one wasn't good. All right, so let's go back and let's do a number five. Instead of doing a minus, let's do a plus. Now, because it saw that five was a string and it said, okay, wait, a string has plus that I can use, it says, okay, I'm gonna concatenate this because I think that's what you meant. Whereas when we had a minus here and it saw it had a string first, it said, wait, strings don't have any minus operator. So I'm betting you meant for that to be a number. So it has all these ideas and tries to fix stuff for you, which can be helpful, but it can also cause problem. So be careful and you can see in this example, if we have number and the word different things can happen. So that's a JavaScript, hey, I'm gonna help you, which sometimes doesn't always help. All right, so what about our variables? Our variables can, anything from strings and numbers to functions, complex data, when you think of a variable, you wanna think of it as a container for the value, not the value itself. So this is my variable that holds Bob. This is another variable I have that holds true. And this is another variable I have that holds a number. So it's just a container, it holds it. I can give it different things to hold, but I don't actually change the things themselves on most of them. All right, so now let's talk about variables. And to use a variable, you need to create a first or to clear it. And I did that in a few of those. I did that and I did it with bar. In a little bit, we'll talk more about which one you should probably use, but we're still going to let you know as you go through this course, you'll see it used interchangeably. Sometimes you'll see let used, sometimes you'll see bar used. And there is a print and we'll talk about in a second. All right, all the instructions in semicolon. So if you're just doing single instructions, you don't need to. So if you're just typing in the console like with the strings, you don't necessarily have to do it, it's just a really good practice to get into because if you don't do it when you're in other stuff, you're gonna get some errors. So when I initialize a variable, I'm giving it a value to start with or an initial value. So when I said my name is Chris, my age is 25. When I said something like that, that's taking that variable I created and value. Or I can do it all in one step, which I did this also. I can say, let my dog equal Rover. And then I have declared it by doing this. This is my declaration. And then this right here, the initializing value. Okay, so I'm gonna do some more examples like that with you or we're gonna change it. Let me get back over here. All right, so let's do, let's do a left. Let's just do what my name, let's do that. And let's find out what my name is. What it's for us if we do that. So right now I defined a variable called my name. I didn't give it any kind of thing to hold on to. So it says it's undefined. So after I do that, if I wanted to, I could say now, my name equals, I forget the semicolons. And then almost forgot to copy this again. So it was undefined whenever I tried to print it the first time. And now it is, wait, because that's what I gave it. All right, so, okay, she don't know. I'm going to use these and notice it changed. That is a comment and I don't want it out anymore. I'm tired of her printing that out. So let's say I wanted to change it at the time. And so let's see, I said it was Hoyt and then I said it was Susan. So let's see what happens when I print this out. So it prints the last one. Okay, so when I said my name is Susan, that's the last one it picked up on. It's going in order that, okay, the last thing that my name was holding on to was Susan. So that's the one I'm going to print. Now I could have done it declared and set it all in. Let's do this. That would be declaring and analyzing all in one step. So in this case, this was value of it. So if I took this off, guess what? It will print first, Lea. And then it printed Susan. It never printed Hoyt because I never had any kind of log in between. Okay, let's see what else do we want to do? Oh, we should change, we should do the eight. I forgot to do that. So age, now I'm just going to leave it like that. And I'm going to do a log to let you see what happens with a number when we don't give it anything to start with. So I said let my age and I wanted to, I'm going to go ahead and comment out that one. And I'm going to comment out this one because I don't need to see those anymore. I'm going to run it undefined. Okay, so looks like it doesn't know what it is. So it's undefined. So let's give it a value to start with. I could give it a value to start with here. Or if I wanted to just declare it and maybe person who wants to declare all my variables way at the top and then I'll give them values later, I could declare it and then later on I could give it. And there it is, 45 again. Let's see, is there any other needs? I don't think so. I think that's all I want to show now. All right, that's a lot of show real fun. I don't know if you noticed, but as I was saying these, I would say stuff like my name and the first word is all lowercase. The second word starts with a capital letter. So I can easily see between the words what they mean. I know in some other languages and stuff, people like to put underscores, but this is really a good convention to use for coding. It is called camel case and it's right here. All names are the letter. You can't start with a number. They have to start with a letter. Camel case is an easy way for you to tell him, hey, this is where this word, and then if I kept going and I had really long words, I could see each word in the whole thing. Case does matter. So I'm gonna go back over here and I'm gonna show you this. So what if I typed it like that? Now, I'm already picking it up saying, hey, I don't think you meant that, but let's say I didn't see that. But if I go to run it, it says right here, my age is not defined, because my age with a capital A is a completely different variable than my age with a capital A. So, case matters. Case matters all the time. You can't use a reserve word. JavaScript already has meanings for things. So if it's like, see how null turns blue like that? See, let turns blue like that. Those mean that they're reserved. So that means you can't name your variable that and you need to find a different name for it. All right. All right, so now let's talk about some other types. So those were strings and numbers that we looked at. Let's talk about Boolean. And values are values that are either true or false. That's it. Those are the only two things they can be. Now, if I declare it and I assign it, so I declared it, and I assigned it all in the line, so this I used camel case, but I did not in this one. Capital I, no. All right. True and false do not have quotes around them. All right, so we're gonna give them up. We're gonna try a Boolean real fast now. So I'm gonna say let's, what did I call it? It means the same one. I am alive. All right, so let's, I, oops, I am alive. Equal. Okay, so let's do console. All right, so I'm gonna get rid of this other console. That way I don't see that. So I said it was true and notice true is also reserved words. What if I said false? Shows up false, no big deal, perfect. Okay. We did try to put quotes around them. It's gonna make it a string and not a Boolean. So then you're gonna have like probably some errors happen later on. All right, an array. An array is the same object that stores multiple. We're not gonna get into these yet. I'm only gonna briefly talk about them. They show you some goals and you can see them and see how they're used but we're just not gonna use them quite yet. An object is a structure and that's also gonna be covered later on. All right, constants are variables that can't change. Try this. And if I go constant, notice, again, or, whoops. Watch that. Okay, so if I do console.long, all right, and I'm gonna comment out the old one again. A lot of times I comment out stuff that I'm testing just along the way. So that way if I wanna come back, I can try it again. I said the constant days and week and then I just said play that. Okay, now what if I try to do this? Days and, whoop, if I could type equals eight. So right here, I said it was a constant. That constant means that I change it. So notice I got an error. So if I try to change something that's constant, I will get an error and it will not let me do it. So that is a don't change it at all. So then it gets to an example in action and it does use var in there. I highly suggest, and I'll again tell you why, but in just a little bit, I have a whole little slide on it, but if you use var, it's fine, right? But you really should use let better to use that now. var is one of the older kind of JavaScript things that you'll see a lot of examples still use and let is just the newest thing that you really should be using. On the examples in action, I'm gonna go to it really fast because I wanna show you it and I did not save it on here. So I'm gonna bear with me while I go back. I'm going back to unit three and I'm gonna come here to our example in action. Here was one of our first ones. This one went through, it was actually about 19 minutes. It was kind of a long video, but this was for the first section and it actually goes through and talks about a lot of stuff that is talked about later and gives you great overview of the whole. And then it has us practice this. So this is finishing from 3.1 and it talks about doing something similar to what I did here, what I did earlier with you about the uppercase and changing things. It also gives you a quick example of an array. Then we're getting 3.2 and that's where we're working at right now. So let's get to 3.2. We've gone through some of this and now we get to our example in action. It's only five minutes, it's not too long. So that's group for mining. You can see what pops up in the oops. So that's called account. So you can see it goes through a whole thing. Every time you're doing one of these example in action, I can't say it enough times that you should be working at the same time. Pause it when you need to. Go in and out if you need to and make sure that you're doing the same thing. In here, they use bar, which will work just fine. For future stuff, you'll wanna remember, hey, maybe I should use let there. Hey, maybe like while they do their example with bar, I'll try to let and see if anything happens. Do stuff like that and practice and get everything. All right, so now we're gonna move on to three, three. Okay, so 3.3 talks about a lot of different operators and I tried to reduce it to just a few for us to talk about here, three operators. Okay, binary operators means two operands, one before and one after. Infix notation, that's what we use in math a lot of times, X plus Y, those type of things. So you have one on each side of your operator. The unary operators have a C brand, either before. So unary operators are when you see X plus plus or plus plus X, whereas these are our binary where we have something on either side of that operator. Okay, all right. So Pandos, we talked about that, but then you also have a full JavaScript operator and what goes first. So as you start to learn all of these other things, then you'll wanna know, hey, do I need to memorize this chart? No, you really should never memorize it. You should just be able to go through and say, hey, which one's gonna have, I'm working with multiplication division. Okay, those are always gonna be up here. And then we get down to stuff like, here's our plus plus and our minus minus. We just talked about. Notice that precedence is what? The multiplication and division. Here's our parentheses have it over this and this, and we keep going. So I'm not gonna talk about each thing here, but we are briefly just touch about bitwise and logical stuff and this. So there's all these different things that you may need to start. Maybe have it somewhere that you could reference, bookmark it, something like that, just so that if you're having some weird issues on your coding, you could always come back and look and see if you've got a problem with the precedent. All right. So the assignment operator is your equal sign. It assigns the value of your right operand to the left. So X equals Y means X is assigned the value of Y. I like to say it evaluates the right side of the equal sign and stores it in the one on the left. So it evaluates here, stores it over there. Now in math, we could do this. We could say Z equals X plus Y, and we could say X plus Y equals Z. You cannot do that. No JavaScript will not take that at all, because what did I say? On the right side of the equal sign, it needs two way. So it would evaluate it, then it would store it in Z. Over here, if you evaluate this right-hand side over here, it could evaluate Z, but there's no way to store Z into X plus Y because that's not a very, it's got to have something to store it in. Short cut assignment statements. In case you like to write code, and that should be a smaller fixing for me, it was X plus Y could all as X plus equal Y, and X equal Y can be written as X or equal Y. It means exactly the same thing. Some people prefer to always write it out. Some people hate writing extra stuff, so they'd like to do this. Whatever you prefer whenever you are programming. All right, it got in state. All right, sorry about that. I don't know what's going on with my internet here. Okay, JavaScript, it also has short cut assignment operators, okay? So X equals X plus Y, you can make it a little bit shorter and not have to double that X. So you just say X plus equal Y. They're the exact same statements. They're equivalent. Prefer to write it out all the time. And again, that should be small X. I need to go fix that. Some people prefer to do this because they try to take any shortcut they have, they can from typing. But exactly the same thing, and it's just, and if you noticed in this down here, we have all of those shortcuts. So you see that there's all of the mathematical shortcut right there too. It's an operator. So we've got a equal equal and equal equal equal. Now right here, we were just talking about an equal sign. Okay, so we've got one equal sign, we've got two equal signs and we've got three. So we need to figure out what the difference is between all of these. So if you notice right here, this is where two variables were declared. They were declared and they were assigned a value. So var one was three, var two was four. Now if I use equal equal, so that's two equal signs, that is gonna compare side to the right side and we'll return true if they're equal. So let's look, is the equal to var one? Yes, it is because var one's value is three. Okay, now this is where it gets weird and JavaScript does that fixing for you. So here it says is three equal one, but it's in a string. It still says yeah, it is. Yeah, because you must have met the regular three and yeah, now it also, when you compare the actual number to string, it will still return true. So you can see where this equal equal could get kind of tricky depending on what kind of coding you're doing. So that's why you really wanna use these right here, the strict equal and the strict not equals. These will only work if they're exactly the same. So if I tried to string three equal to var one, it's gonna return false because it is not exactly the same because they're not the same data types, okay? So one equal back as assignment, here to see are they in whatever I'm trying to compare? Are they kind of the same? This one is like, no, they have to be exactly the same. They have to be the exact same data type and they have to completely compare. Then if you come down that greater than and equal to less than, less than or equal to. So all those are just your basic math. Then we have a remainder, which was called modulus. So I would take 12, I would divide it by five and that would send me a remainder of two. So the result of 12 minus five is two. Increment adds one. Decrement takes away one and I can do x plus plus plus and add two. So there's only two pluses, two minuses. That's it, it's not like our equal signs where we also have three of them, okay? Exponential, you might need to use x. If you did, notice it is the two stars right here. So two star star three is gonna be two to the third power, which is eight. All right, bitwise operator. Now these are gonna happen whenever we're performing stuff or numbers. Not going into them too much. They talk about a little bit there. You'll see that later on more so. Important ones that we probably will see a lot of is the and, the or and the not. Those are our logical operators. An and, both things have to be true. An or, just one has to be true. And the not is just the opposite. If it was true, it becomes false and if it was false, it becomes true. If you've worked at other languages like Java, you know that Java has short circuit evaluation. Java script does also. What does short circuit evaluation mean? Well, if I had an and, I just told you that an and has to have everything true. So if I'm reading something and it has an and in it and the very first thing I see here is false, then that means everything on this side I don't even need to look at. The, I don't know, 25 other like operations over here doesn't matter. I'm not going to look at it because false with anything is going to be false. And the same idea, if I have an or or just something has to be true, then if the first thing is a true, it doesn't matter what's on this side. I'm not even going to look at it. So any kind of operation happening over here, it's not going to get done because we're going to short circuit out in some time. A unary operator that you'll see used throughout this course, especially in this whole section is going to be type up and type up will tell you, hey, 62 is a number. This is a string and it will give you that kind of information. So that's really the one that you see here. All right, there's another weird thing. All right, ternary operator. Ternary operator is, instead of your typical if else, you might see code like this. I had a student just recently that was looking at trying to learn some new stuff. Come to me and he's like, what is this? We talked about it. And so when you think about it, instead of writing the whole if else, we're not really talking about yet until another section, a unit of this. How it works is that if the condition is true, then you will do that. If the condition evaluates to false, you do that too. So it's definitely like an if else. It just doesn't have those key words in it. So in this case, I made a bar called status. It's equal to, my internet connection's unstable, okay. Okay, let me try that again. Bar status equals, if age is greater than 18, so if this is true, then adult status becomes, if this is not true, minor is what status becomes. So you see this, you do see it a lot in coding, especially if you're starting to look at some other people's code on the internet and stuff like that. You will see this as people because they're looking for that if else. They're looking for that kind of, but returnary operator. And so it has three operands in case you didn't notice. It's got your condition, value one and value two. So condition, true status, does that. All right, we talked about these, okay. Assignment is one, equality is two. Equality with three sides. That's the one we really want to use. The two equals will compare, but ignore data type. The three equals compares, but it also checks your data type. So that's really, really what you want to do. All right, hold on, I'm gonna get my note up. So I make sure I'm at the, okay. Three ways to declare the variables. We've done all three of these today. Bar declares a variable that gives it what's called global scope. And that's the reason we want to kind of avoid it. Let declares a block scope local variable. And constant is read only, I can't change. And we saw that earlier because I did that and we couldn't change it, it actually gave us an error. The whole bar thing goes along with something that you see in this unit where they talk about hoisting. And JavaScript treats all the variable declarations using var as if they're declared top of the function or the global whatever it is. So look at this little example right here. I'm just starting at the beginning. I said a is five and I did console.loga and then I did var a and it seems, let's go try this. Let's go over here. I'm gonna get this out of my way. Let's clear out all this. All right, so what are we gonna try? We're gonna go ahead and try. I'm gonna try to get this out of my way again. We're gonna try to do this. So we're gonna say a is five. I'm gonna go console.loga. So let's do that. A equals five, great. Okay, then let's do what? Console.loga. Okay, let's run it. All right. All right, great. Okay, now if I do this. And that's all they did. They just said var a at the end. And so if I did that and I hit semicolon, it doesn't change anything. All right, let's try this again, but we're gonna try it with left. Okay, let's go run it. Notice this error. I can't act a before initialization. I tried to give a value. I said a is five, but then down here, I decided to say, oh, but I wanna declare a, I can't do that. I would have to have, if I'm using let's, this here, I have to declare before I try to use it. So let's, let me get back to it. So if I get back to here, let's, if I did this, it's not gonna work for, but it works for var. Does that make it terrible? It just isn't a great programming part. Okay, so try to avoid it. When you can use let instead of var, and I think you'll, you'll see it, it becomes a habit after that. All right, really fast block statements. So here's a block, we have these curly braces. Notice I have a var up here and a let here, and I have a var in here and a let in here. So these have different scope. These are outside of the block and these are inside the block. So when I print these, notice what how my let, why, when it is printed, it prints the one of the block it's in. So I'm not the block here on my console, and it won't. Even though I am not inside the block on this var, it went ahead and grabbed that one because it has a global scope. So that's another reason to just try to not use var because it's gonna give you some weird results. All right, I'm running through this a little bit faster. Okay, so practice data types and arithmetic operators. It talks, going here, there, and I think I'm running a little bit long here. So I'm not gonna go saying, but I do wanna show you here. We are on the practice in 3.4 for data types and arithmetic. It says the following examples demonstrate using this stuff. So I go to the next page. When I get to the next page, it tells me, hey, like this, so I can just grab it. Whoops, not that much of it. And I can come back over here, and I'm gonna throw it in here. And now I can play around with all this stuff that they have given. I don't need to worry about this stuff. This is just displaying it. But I can take off the var, and I can turn them into lets. I can change my numbers. I can change my strings. I can play around with everything. That's the best part of all these practice things, and then I can go to the next one, and then I can play around with all this math stuff and see what's gonna happen. I might wanna practice modulus and make sure I know how to do modulus. Make sure I know what the output is gonna be, and then I can change numbers, change things here. All right. So then we finish that, and then we get to our assessment. In our assessment, one through nine are gonna be mixed type questions, and number 10 is using code. So I'm gonna show you something quickly on Code Runner. Read all directions every time you see Code Runner. You're gonna see where it is gonna be hard to see. So let me get there really quickly before we end. And all right, let's get down here to our, so we're ready to do the assessment. We've gone through these reviews. We've tried them all ourselves. Oops, I am not logged. Let me log in. Hold on. It's logging me. Let's try again. Place that log in. Okay, back to my job here. All right, we're on unit three. Let me get back down here into my assessment. Let me get my attempt. All right. Let me get back to... I'm gonna start a whole new preview. Let me do that. All right. So questions one through nine. You got everything. You've got your truth matching. You've got fill in the blank. Then we get 10, which is gonna be in our Code Runner. Our Code Runner, again, here it is. We've got our JavaScript, our CSS. And then we got HTML here. And you hear that we have our JavaScript inside the HTML. So always make sure you come up here and read. So it tells you, okay, here's your formula that you're gonna need. So you're gonna need to use that. You're going HTML pane to see all your code. So right now it's hard to see because I have to do this. Well, that's fine. I can totally bring it down here so that way I can see everything. Right, the HTML, HTML after the comments for lines one through. So if you see here, it says declare on one line these variables. So I'm gonna pretend I'm doing this. So watch, I'm gonna get left. Now you saw me type left. So when I go left and I get ready to do original currency, do you see how you might be going, where did it go there? It's just really light blue and it's right there. So just be careful when you're doing that that you make sure that you know that your lead is there. You might need to highlight it, whatever you need to do to make sure you can see it. So you'll do each of these. And as you go through, once you get those done, what else does it say? It says to use single quotes for strings. So make sure you do that. Write the code for the alert in the JS pane. All right, so I'm gonna come down here. Not gonna use that pane. Okay, notice as soon as I typed alert, what happens? This starts coming up and it will keep coming all the time. So what you might wanna do, which is what I do when I'm doing things is I comment it out like this until I'm pretty sure that I'm done with everything and everything's good. And then I'll take the alert off and let it go ahead and run. Because otherwise it'll drive you crazy because it just keeps coming up and coming up. So that's definitely something you wanna keep in mind as you're doing this. All right. Okay, I'm sorry. Seemed like this went forever and I just hit share instead of slide chat. Unit four is gonna be our next ever. Conditional statements and control. So you're talking some ifs, you're talking things like that. So only about two hours. This unit itself had a lot of content in it and that's why I struggled with how I was gonna break it up with you. We will be using if else, while. We're gonna use the relational bullion so those wars that we just touched on today. And then we'll have choices that people can make based on conditions. The next live session is next Tuesday, November 29th at 5.30 Eastern. And I will make sure that my internet is working better by then. I hope everybody was able to hear it. Make sure you go sign up for the course. You're going ready and thank you for joining us. Well, thank you so much for taking us through all of this and thank you everyone for joining us. And of course, as mentioned, join us next time. Feel free to leave a comment in the comment section down below. Of course, there's a link to the previous videos in this series as well as the Sailor Academy course that they are a part of. So definitely go check those out. Again, Susan, thank you so much for taking us through this. Thank you so much everyone for joining us and we will see you the same JavaScript time, same JavaScript channel next week. Bye everybody.