Node.js Backend Fundamentals

Lesson 2 of 6

Variables and Data Types

JavaScript in Node.js supports let, const, and (legacy) var.

JavaScript

Core types

TypeExample
string'hello'
number42, 3.14
booleantrue
object{ id: 1 }
array[1, 2, 3]
null / undefinedabsence of value

Prefer const by default; use let only when you need to reassign.

📝 Variables Quiz

Passing score: 70%
  1. 1.Which keyword declares a variable that cannot be reassigned?

  2. 2.What is the output of: console.log(typeof [1, 2, 3])