Добавить
Уведомления

Variables and Data Types in JavaScript | COMPLETE JAVASCRIPT COURSE | Learn to CODE By Coding in JS

In this video, you will learn about the fundamental concept of variables and Different Data Types Variables are a fundamental concept of every programming language in the world, but what actually is a variable? Well, we can say that a variable is like a container in which we can store a value in order to use it over and over again in our code, instead of having to write the value each time that want to use it. Throughout the section here, I will be using variables about persons for all the examples, so stuff like names or jobs or age or something like this. This is a good time to actually talk about different data types in JavaScript. In JavaScript, there are five different data types: Number, String, Boolean, Undefined and Null. So far, we have already seen the Number and the String. Now primitive data type just means that it's not for objects, unlike most things in JavaScript. So they are just simple, primitive, non-object data types. First off, we have Numbers, and JavaScript numbers are always floating point numbers, which simply means that they always have decimals, even if we sometimes don't see or even don't define them. For example, five, it's like having five point zero. In other programming languages, many times it doesn't work like this and you have different data types for integers and decimals, but not in JavaScript. So here, all numbers are simply float numbers even if they look like integers. Next up, we have Strings which are simply a sequence of characters and so they are just used for text like, with the example before, with the last name and the first name. Next up, the Boolean data type is a logical data type that can only take one of the logical values true or false. To make it simple, a Boolean is always either true or false. And we will see why this is very important over the next lectures. The next one is a bit more difficult to understand. Basically, Undefined is the data type that is automatically assigned to a variable that doesn't have a value yet. All right, and that's it, now let's actually see these things in action again, and move back to our code. And, all right, that's actually all there is to know about the fundamentals of variables and data types. That's already a huge step forward and a very important concept in any programming language of the world. In the next video, we're gonna dive a bit deeper into variables and do some more stuff with them, so stay tuned for that next video.

12+
16 просмотров
2 года назад
12+
16 просмотров
2 года назад

In this video, you will learn about the fundamental concept of variables and Different Data Types Variables are a fundamental concept of every programming language in the world, but what actually is a variable? Well, we can say that a variable is like a container in which we can store a value in order to use it over and over again in our code, instead of having to write the value each time that want to use it. Throughout the section here, I will be using variables about persons for all the examples, so stuff like names or jobs or age or something like this. This is a good time to actually talk about different data types in JavaScript. In JavaScript, there are five different data types: Number, String, Boolean, Undefined and Null. So far, we have already seen the Number and the String. Now primitive data type just means that it's not for objects, unlike most things in JavaScript. So they are just simple, primitive, non-object data types. First off, we have Numbers, and JavaScript numbers are always floating point numbers, which simply means that they always have decimals, even if we sometimes don't see or even don't define them. For example, five, it's like having five point zero. In other programming languages, many times it doesn't work like this and you have different data types for integers and decimals, but not in JavaScript. So here, all numbers are simply float numbers even if they look like integers. Next up, we have Strings which are simply a sequence of characters and so they are just used for text like, with the example before, with the last name and the first name. Next up, the Boolean data type is a logical data type that can only take one of the logical values true or false. To make it simple, a Boolean is always either true or false. And we will see why this is very important over the next lectures. The next one is a bit more difficult to understand. Basically, Undefined is the data type that is automatically assigned to a variable that doesn't have a value yet. All right, and that's it, now let's actually see these things in action again, and move back to our code. And, all right, that's actually all there is to know about the fundamentals of variables and data types. That's already a huge step forward and a very important concept in any programming language of the world. In the next video, we're gonna dive a bit deeper into variables and do some more stuff with them, so stay tuned for that next video.

, чтобы оставлять комментарии