07:31Learn JavaScript TYPE CONVERSION in 5 minutes! 💱
From the creator
// type conversion = change the datatype of a value to another // (strings, numbers, booleans) // --------------- EXAMPLE 1 --------------- let age = window.prompt("How old are you?"); age = Number(age); age+=1; console.log(age, typeof age); // --------------- EXAMPLE 2 --------------- let x = "pizza"; let y = "pizza"; let z = "pizza"; x = Number(x); y = String(y); z = Boolean(z); console.log(x, typeof x); console.log(y, typeof y); console.log(z, typeof z);
Published 2023-10-18 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.





