This course has been updated! We now recommend you take the Complete Intro to Web Development, v2 course.
>> Nina Zakharenko: And really important to consider, don't forget the var. Like right here, this var y. Don't forget that keyword when you're using a variable for the very first time. If you don't have it in there, and you use that same variable name again, you might accidentally overwrite it.
[00:00:49] And we'll talk about scope a little bit more in detail later.
[00:01:22] Variables either start with a lowercase letter, a dollar sign, or an underscore. But make sure they don't contain any special symbols like exclamation point or pound, hashtag, whatever you wanna call it. That's not supported, and you'll get an error.
[00:02:07] There's a pretty long list of them and after class you can go through it there's a link on the bottom of the slide.
[00:02:28] So, strings are contained in two quotes. It's any sort of characters, numbers that you won't be using mathematically. Numbers don't have the quotes and they can be with or without the decimal. So if we go
>> Nina Zakharenko: Back into our
>> Nina Zakharenko: Console here.
>> Nina Zakharenko: Sorry, I'm trying to make it bigger, it's.
>> Nina Zakharenko: There we go.
>> Nina Zakharenko: Can everyone see that font? So, let's try to declare some variables.
>> Nina Zakharenko: So this variable is called name and it's a string because it's in quotes. If you press enter, you'll see undefined which means that running this line of code, didn't return anything.
[00:04:09] So, if we do typeof name, we're gonna get back a string, typeof age is a number. We'll talk about functions later on but let's create an empty one let's call it myFunc.
>> Nina Zakharenko: So a totally empty function it takes no arguments if we do typeof myFunc we'll get back a function.
>> Nina Zakharenko: So another kind of variable type is a Boolean. And Booleans can have two values. True which is yes or false which is no. There are also special types, if you declare a variable and you don't set you don't put anything in it the value of that is undefined.
[00:05:21] If you want to explicitly empty a variable you can set it to null. And that'll clear out the value.