Skip to content

Basics of Programming

Syntax: The rules for valid formats and combinations (Grammar for computer languages)

Statement: A group of words, numbers and operators that perform a specific task

eg: a = b * 2;

a, b: Variables: Symbolic placeholders for values or represents a value

2 : Literals: Standalone value without being held in a variable

= , *: Operators: Performs actions with literals and variables

; : End of statement

Statements are made up of one or more expressions.

Expressions: Reference to a variable or a collection of variables and values combined with operators

2: literal expression b: variable expression b * 2: arithmetic expression a = b * 2: assignment expression

b * 2; is also a expression which does not have any effect on the program that is running.

alert(a); : is a call expression for running functions

It is a series of statements that make a computer program.