My First Steps in JavaScript: A Simple Breakdown

Published: (December 5, 2025 at 08:44 AM EST)
1 min read
Source: Dev.to

Source: Dev.to

Variables in JavaScript

let

Used for values that can change later.

let age = 20;
age = 21;

const

Used when the value should not be changed.

const PI = 3.14;

var

The old way of declaring variables. Not recommended now because it creates confusion with scope.

Data Types in JavaScript

Primitive Types

  • String"Hello"
  • Number23, 45.6
  • Booleantrue or false
  • Null → empty value
  • Undefined → no value assigned
  • BigInt → very large numbers
  • Symbol → unique values

Non-Primitive Types

  • Object
  • Array
  • Function

Undefined vs Null

undefined

Means a variable exists but has no value yet.

let x;
console.log(x); // undefined

null

Means intentionally empty. We set it manually when something should have no value.

let data = null;
Back to Blog

Related posts

Read more »

It’s time to free JavaScript

Article URL: https://javascript.tm/letter Comments URL: https://news.ycombinator.com/item?id=46145365 Points: 104 Comments: 34...