In this movie, we're going to look at manipulating values. Now the manipulation of values in JavaScript is done with operators. And so we'll be learning some of the operators will mainly look at strings, and numbers. So I'm going to open the JavaScript console. Now this is just a web page that I was showing this information on. So I'm able to open up the console.
Let me make the text a little bit larger so we can see it better. And then I'm also going to enter a command clear so we can clear off the screen. Now, if your Java JavaScript console is still opening up on the bottom of the HTML page, and you want to change that, I just want to point out this little menu over here in Chrome, the developer tools in Chrome, you can choose how you want that Java JavaScript console. docked in my console is currently undocked. Alright, so let's take a look at some strings. Very simple string right there.
It was I gave an example, if we enclose the number in it in quotes, it's also a string. Another way to do strings is with single quotes. That's a string as well. Now we can manipulate strings using the concatenation operator, which is the plus symbol. Let me put those two together. Notice how it displays it put Steven and 47 together and displays it all as a single string.
Now something else to be aware of with strings is let's say I wanted to enter something like this as a string. Now that works fine. Notice there's a single quote in the middle That works fine because there's double quotes on the outside. However, what if I would have done this using single quotes. That gives us a syntax error. Basically, Stephen is a string, and then S space computer.
It's not sure what it is, and so it's unexpected. So there is something called an escape sequence. So let's do the same thing again. Do an escape sequence for a single a single quote, and those that comes out just fine. So that that backslash is an escape sequence. We can do that with double quotes as well.
Escape sequence here. escape sequence again. And there's our string. So there's a little bit about working with strings. Let's take a look at numbers. As I said very simply, that's a number.
That's the number. That is a number as well. Now, what are some ways we can work with numbers? Well, we can, of course, add numbers. That comes back with the results. We can multiply numbers.
And the multiplication is an asterisk. That's the multiplication operator. We can do division. The Division operator is a slash. We can do some subtraction as well. Now just like in regular mathematics, there's an order of operation in JavaScript as well.
So if we were to do something like three plus four times two, the order of operations says the multiplication must be executed first, and so four times two is executed and then we add three, and we get the result of 11. However, if we introduce parentheses now, the addition will happen first three plus four is seven times two is 14. Okay, so that is some of the operators used to work with numbers. Now we've looked at both strings and numbers Boolean. So as I mentioned, there are only two values true and false. Those are both Boolean values.
They're most of the operators we used to work with Booleans our comparison operators and we'll take a look at those a little bit later. So this gives you an introduction to values and types and also how to manipulate them a bit.