Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 291 Bytes

File metadata and controls

15 lines (11 loc) · 291 Bytes
// Example 1
let boo = false;
alert(typeof boo); // boolean

boo = String(boo); // now value is a string "true"
alert(typeof boo); // string

// Example 2
const str = "123";
alert(typeof str); // string

const num = Number(str); // becomes a number 123

alert(typeof num); // number```