Member-only story
Statement, Expression, Value, Literal
In this post, we’ll take a closer look at some frequently used terms in development: Statement, Expression, Value, and Literal — and define them more precisely.
Statement
A statement is the basic unit of execution in a program — the smallest standalone element that performs an action.
A collection of statements makes up a program, and writing statements in order is essentially what programming is.
Here’s an example of a single, complete statement:
const num = 1 + 2;A statement is composed of multiple tokens.
A token is the smallest unit of code that can’t be broken down any further in terms of syntax.
Let’s break the example down into tokens:
const, num, =, 1, +, 2, ;Each part -const, num, =, etc. -is a token.
Statements can be classified into various types: conditionals, loops, declarations, assignments, and so on. These are all different types of statements.
Value
A value is the result produced when an expression is evaluated.
(Don’t worry — we’ll talk about expressions in just a second.)











