JavaScript Cheat Sheet
-
What are the essential JavaScript features?
Topic Syntax or methods Variables const,let,varArrays map,filter,reduce,pushObjects Destructuring, spread syntax Comparison ===,!==Strings split,slice,includesFunctions Regular and arrow functions Numbers Number,parseInt,MathDates Date,toISOStringRegex test,match,replaceDOM querySelector,createElementEvents addEventListenerErrors try,catch,finallyAsynchronous JS Promises, async,await -
What are some recommended practices?
Prefer
constby default, use strict equality, and avoid inserting untrusted content usinginnerHTML.
Example
const numbers = [1, 2, 3, 4, 5];
const result = numbers
.filter(n => n % 2 === 0)
.map(n => n * 2);
console.log(result); // [4, 8]Reference
WebsiteSetup JavaScript Cheat Sheet, supplemented with modern JavaScript practices.