VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Data Types - Beau teaches JavaScript

Data Types - Beau teaches JavaScript

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Learn about the seven data types in JavaScript ES6 (ECMAScript 6). Code - http://codepen.io/beaucarnes/pen/dOxXWK?editors=0012 Other resources on topic: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript - http://www.w3schools.com/js/js_datatypes.asp Beau Carnes on
Date: 2022-03-14

Comments and reviews: 6


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

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

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


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

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

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