JavaScript — Command Reference
JavaScript's most used commands, methods, and structures — each with syntax, explanation, working example, and real-world usage. Choose a category, click a command, try the example yourself.
9 categories · 46 commands
🖥️
Output & Console
Printing values, concatenating strings, and checking types.
console.log()Template literal ( `` )typeof📦
Variables
Storing values: let, const, and var.
let / constvar (legacy)🔢
Numbers & Math
Numeric operations, rounding, and Math functions.
Math.round()Math.floor() / Math.ceil()Math.max() / Math.min()Math.random()+3✍️
String
Text length, conversion, slicing, splitting, and searching.
.lengthtoUpperCase() / toLowerCase()trim()slice()+3📋
Array
Working with ordered data collections and powerful array methods.
arr []push() / pop()shift() / unshift()indexOf() / includes()+7🗂️
Object
Data structured with key-value pairs.
object {}Object.keys() / values() / entries()🔁
Condition & Loop
Decision-making and repetition structures.
if / else? : (ternary operator)switchfor+2🧩
Function
Defining and reusing your own commands.
functionArrow function (=>)Default parameter...rest / ...spread🔄
Type & Conversion
Type conversion and equality check.
Number()String()Boolean() / truthy== vs ===