Starlit Daily

📚 › JavaScript: make pages do things

3. Data types: numbers, strings, booleans

इस लेख का अनुवाद अपने आप होगा। अभी अंग्रेज़ी में दिखाया जा रहा है।

JavaScript has numbers (42, 3.14), strings ("text"), and booleans (true or false). typeof tells you the type of a value.

A template string uses backticks and ${...} to put values inside text: `Hi ${name}`.

उदाहरण देखें

let n = 42;
let s = "text";
console.log(typeof n, typeof s);

✍️ अब आपकी बारी

Let age = 21 and print the text: I am 21 years old, using a template string.

← कोर्स पर वापस