Brendan Eich created JavaScript in just 10 days at Netscape Communications. Originally called "Mocha", then "LiveScript", finally renamed to "JavaScript" for marketing reasons.
JavaScript was standardized as ECMAScript (ES1) by ECMA International to ensure compatibility across different browsers.
Ryan Dahl created Node.js, bringing JavaScript to server-side development and enabling full-stack JavaScript applications.
Node.js revolutionized web development by allowing developers to use JavaScript for both frontend and backend, creating the foundation for modern full-stack development.
Creator of Node.js
Major update introducing classes, modules, arrow functions, promises, and many other modern features that transformed JavaScript development.
ECMAScript now follows an annual release cycle (ES2016, ES2017, ES2018, etc.) with continuous improvements and new features.
Creator of JavaScript (1995)
Co-founder of Mozilla
JavaScript engines are programs that execute JavaScript code. Each browser and runtime environment uses different engines with unique optimizations and features.
| Engine | Used In | Developer | Language |
|---|---|---|---|
| V8 | Chrome, Node.js, Edge | C++ | |
| SpiderMonkey | Firefox | Mozilla | C++ |
| JavaScriptCore | Safari, WebKit | Apple | C++ |
| Chakra | Internet Explorer, Legacy Edge | Microsoft | C++ |
JavaScript is a high-level, interpreted programming language that is one of the core technologies of the World Wide Web. It enables interactive web pages and is an essential part of web applications.
JavaScript programs are composed of statements that are executed by the browser. Each statement performs an action.
Comments are used to explain code and make it more readable. They are ignored by the JavaScript engine.
Variables are containers for storing data values. JavaScript has evolved from var to modern let and const declarations with different scoping rules.
JavaScript is a dynamically typed language with weak typing, meaning variables can hold different types of values and automatic type conversion occurs.
typeof null returns "object" (historical bug)typeof [] returns "object" (arrays are objects)typeof NaN returns "number"Array.isArray([]) to check for arraysNumber.isNaN(NaN) to check for NaNvalue === null to check for nullArrays are ordered collections that can hold multiple values of any type. JavaScript arrays are dynamic and provide powerful built-in methods.
This table summarizes the main operator categories with brief examples and expected results.
| Category | Operators | Example | Result / Notes |
|---|---|---|---|
| Arithmetic | + - * / % ** |
3 + 2 |
5 (basic math; % is remainder; ** is exponent) |
| Assignment | = += -= *= /= %= **= |
let x = 5; x += 3; |
x becomes 8 |
| Comparison | == != === !== > >= < <= |
5 === '5' |
false (=== checks type and value; avoid == quirks) |
| Logical | && || ! |
true && false |
false (short-circuit evaluation) |
| Bitwise | & | ^ ~ << >> >>> |
5 & 3 |
1 (operates on 32-bit integers) |
| Unary | + (unary), - (unary), ++, -- |
+"5" |
5 (string to number coercion) |
| Type / Property | typeof, in, instanceof |
typeof 'hi' |
"string"; 'key' in obj, arr instanceof Array |
| Conditional | ?: (ternary) |
isAdmin ? 'Yes' : 'No' |
Returns one of two values based on condition |
| Nullish / Optional | ??, ?. |
null ?? 'default' |
Returns fallback when left side is null or undefined; user?.profile?.name |
| Spread / Rest | ... |
[1, ...[2,3]] |
Expands or collects values (arrays/objects/functions) |
| Delete / Void | delete, void |
delete obj.key |
Removes a property; void 0 yields undefined |
| String Concatenation | + |
'a' + 'b' |
"ab" (use template literals for readability) |
| Comma | , |
(a = 1, b = 2, b) |
Evaluates leftโright, returns last expression |
Strings are used to represent text data. They can be created using single quotes, double quotes, or template literals.
length - Get string lengthtoUpperCase() - Convert to uppercasetoLowerCase() - Convert to lowercasecharAt() - Get character at indexindexOf() - Find substring indexslice() - Extract portion of stringsplit() - Split string into arrayreplace() - Replace substringFunctions are first-class citizens in JavaScript - they can be stored in variables, passed as arguments, and returned from other functions.
function name() {}
const name = function() {}
const name = () => {}
function(a = 5)function(...args)function({name, age})Objects are collections of key-value pairs. They can contain properties (data) and methods (functions).
Control structures allow you to control the flow of your program execution.
if...else - Conditional executionswitch - Multiple condition checkingternary operator - Shorthand conditionalfor - Known number of iterationswhile - Condition-based loopdo...while - Execute at least oncefor...in - Iterate over object propertiesECMAScript 2015 (ES6) and later versions introduced many powerful features that modernized JavaScript development.