JavaScript Basics
Data Types
• Numbers
• Strings
• Boolean
• JS is a dynamically typed language
Operators
• Assignment operators = , +=
• Comparison operators == , != , < , >
• Arithmetic operators +, - , /, *
• Bitwise operators
• Logical operators
• String operators
• Special operators
Control Flow
if (condition)
statement_1
[else
statement_2]
Loop
for ([initialExpression]; [condition];
[incrementExpression])
statement
while (condition)
statement
Functions
A function definition (also called a function
declaration) consists of the function keyword,
followed by
• The name of the function.
• A list of arguments to the function, enclosed
in parentheses and separated by commas.
• The JavaScript statements that define the
function, enclosed in curly braces, { }.
function square(number) {
return number * number;
}

Road to code