Tsallaka zuwa abun ciki
Justice Tech School

Data Types

The main types are string (text), number, boolean (true or false), undefined, null, object and array. typeof tells you the type of a value.

Strings can use single quotes, double quotes or backticks. Backticks allow template strings with ${ } placeholders.

Example
const name = "Ada";
const age = 21;
const isStudent = true;
console.log(typeof name);
console.log(typeof age);
console.log(typeof isStudent);
console.log(`${name} is ${age} years old`);

Exercise

Find the type of the value.

console.log( 42);

Quiz Test

What does typeof "hello" return?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.