Transcript
00:00 Alright. Like I said, hopefully, it was pretty straightforward. We're gonna console log each one of these. The AI is really good at this. Let's talk about what it's doing in each case.
00:08 So, it's actually kinda similar to concatenation, with this plus character, but it's doing a completely different thing. Rather than taking two strings and putting them together, we're actually taking these two numbers and, summing them together. And so here, if I save this twenty five and seventeen, evidently, it's 42. We could actually put one of these in a string and you can add those together and now it turns the whole thing into a string. This is what we call coercion.
00:35 We are coercing this 17 into a string so that it can be properly added to another string. So if one of these things is a string, you can't add a string to a number. So we're going to turn the other one from a number into a string and then we can add them together. This might catch you, off guard in in some ways. Sometimes, you're going to have a variable that contains a string that looks like a number.
00:57 So like it contains the number 25, but it's actually a string data type. And so that's gonna throw you, for a loop sometimes. If you ever see something like this, that's what's going on and you need to convert that string into a number and you'll learn how to do that a little bit later. So, here we're adding those numbers together. Here we're multiplying.
01:15 Here we're dividing. And then parenthesis works the same way as the order of operations in your regular math class that you've, taken before. So, we've got 10 plus five times two, fifteen times 30 or times two is 30. So there you go. That is, number expressions.
01:33 There are actually a bunch of others. So you've got, exponential or exponents. Yeah. And you've got, in fact, there's a whole library of math operations, sine, cosine, everything, not through operators like this, but, using a math object that's globally available. And you can look at that later.
01:52 But this is the syntax for operating with numbers. I hope you enjoyed it.
