
Data Types - Beau teaches JavaScript
video description
Date: 2022-03-14
Related videos
Comments and reviews: 6
Muhammad
GRAND SUMMARY
Booleans - Watch in video.
Null - means nothing or zero if you do math with it ! Use when some variable has no value assigned to them.
Undefined - is not similar to null. means that a variable has either not been declared at all OR has been declared but holds no value. yield NaN if you do math with it. Is NOT zero.
Number - Watch in video.
Symbols - Their instances are unique and immutable. so if two symbols,
sym1 = Symbol (-foo-) and sym2 = Symbol (-foo-) are compared; sym1 === sym2 , it will give false.
if you typecast them both to string, it will give true ! but typecasting to string also means that it will print like -Symbol(foo)- in console ...
Object - It is a collection of properties. Properties themselves are key-value pairs.
reply
GRAND SUMMARY
Booleans - Watch in video.
Null - means nothing or zero if you do math with it ! Use when some variable has no value assigned to them.
Undefined - is not similar to null. means that a variable has either not been declared at all OR has been declared but holds no value. yield NaN if you do math with it. Is NOT zero.
Number - Watch in video.
Symbols - Their instances are unique and immutable. so if two symbols,
sym1 = Symbol (-foo-) and sym2 = Symbol (-foo-) are compared; sym1 === sym2 , it will give false.
if you typecast them both to string, it will give true ! but typecasting to string also means that it will print like -Symbol(foo)- in console ...
Object - It is a collection of properties. Properties themselves are key-value pairs.
reply
Jatin
Thanks for these tutorials, big fan of FCC. Ok, the undefined and Null is not, ahem, well defined. :). Speaking from what I have learnt from FCC itself, here is an e.g. of undefined -a bit different from Null.
var test = function(a,b) -
a+b;
-
console.log(test(1,2)); //this will give you undefined
reply
Thanks for these tutorials, big fan of FCC. Ok, the undefined and Null is not, ahem, well defined. :). Speaking from what I have learnt from FCC itself, here is an e.g. of undefined -a bit different from Null.
var test = function(a,b) -
a+b;
-
console.log(test(1,2)); //this will give you undefined
reply
ptaczek
Hi, there is no data type null in javascript. If you declare a variable without initialization, it's type is -undefined-. But if you initialize the variable to null, it's type is -object-. As you said, null is a value that means -no value-. Null is not a data type.
reply
Hi, there is no data type null in javascript. If you declare a variable without initialization, it's type is -undefined-. But if you initialize the variable to null, it's type is -object-. As you said, null is a value that means -no value-. Null is not a data type.
reply
sarfaraz
var name1 = Symbol(-Description 1-);
var name2 = Symbol(-Description 2-);
name1 = -John-
name1 = -Smith-
console.log(name1);
If the value are unique than why John is overwriting Smith What is the use of Symbol in this code?
reply
var name1 = Symbol(-Description 1-);
var name2 = Symbol(-Description 2-);
name1 = -John-
name1 = -Smith-
console.log(name1);
If the value are unique than why John is overwriting Smith What is the use of Symbol in this code?
reply
rahul
Hi Beau. Thanks for putting so much effort into this . This tutorial is just amazing.
I have a question. Why does plus operator and multiplication operator behave differently when used with a null value.
1 + null = 1;
but
1 - null = 0;
reply
Hi Beau. Thanks for putting so much effort into this . This tutorial is just amazing.
I have a question. Why does plus operator and multiplication operator behave differently when used with a null value.
1 + null = 1;
but
1 - null = 0;
reply
Galejandro84
great tutorial
but i think it is a lot much easier to understand Object type:
var myCar = -
make = -Ford-,
model = -Mustang-
-;
reply
great tutorial
but i think it is a lot much easier to understand Object type:
var myCar = -
make = -Ford-,
model = -Mustang-
-;
reply
Add a review, comment
Other channel videos















