Type conversion in JavaScript 💱【4 minutes】

preview_player
Показать описание
#Javascript #type #conversion

// type conversion = change the datatype of a value to another
// (strings, numbers, booleans)

age = Number(age);
age += 1;

/*
let x;
let y;
let z;

x = Number("pizza");
y = String(3.14);
z = Boolean("pizza");

*/
Рекомендации по теме
Комментарии
Автор

// Type Conversion = change the datatype of a value to another
// (strings, numbers, booleans)

let age = window.prompt("How old are you?");

//console.log(typeof age);
age = Number(age);
age += 1;

console.log("Happy Birthday! You are", age, "years old");

/*
let x;
let y;
let z;

x = Number("pizza");
y = String(3.14);
z = Boolean("pizza");

console.log(x, typeof x);
console.log(y, typeof y);
console.log(z, typeof z);
*/

BroCodez
Автор

finding this youtube channel is the best thing that happens to me, I love how you talk and the use of memes to make the learning less boring, you are my best friend.

evilchamps
Автор

When the world needed him most... he came back.

i missed the notifications for the other videos
gonna watch them rn.

egyptcountryball
Автор

bro thank you very much for all what you do
You let me miss the long tutorials
straight to the point no delay

WOLYON-x
Автор

Always a good tutorial, clear and concise

elliotradley
Автор

I noticed the data type must be capitalized. Also, on the Boolean, a "0" value to the variable reads as true in js.

leechurchill
Автор

Well Explanation Bro...could you please make videos on Jquery and React JS.

prof.zeeshanhaider
Автор

English teacher: "The first word in a setence has it's first letter capitalized."
JS: //All words in a sentence are capitalized, except the first.
//Also i don't believe in spaces, what are you, ILUMINATTI?

Seven_Red_Suns.
Автор

Not a Number is type "number" lol
Cheers Bro!

minimalistEXTREM
Автор

can somebody please share the code in the html tab. when i try Open with Lab Server the prompt does not appear. Thanks

zaldyrafanan
Автор

age = Number(age);
x = Number("pizza");
y = String(3.14);
z = Boolean("pizza");

henryhsu
Автор

random comment to destroy the youtube algorithm

oximas-oevf
Автор

Random comment for the YouTube algorithm!

MohyDev
Автор

Am I the only one who thinks he sounds like Josh from let’s game it out?

Cram_Chse
Автор

Always a good tutorial, clear and concise

candicejacobs
join shbcf.ru