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.

← العودة إلى الدورة