Loading lesson path
JavaScript
Strings, numbers, arrays, maps, sets, dates, regex, and the built-ins you use every day.
Strings are for storing text Strings are written with quotes Using Quotes A JavaScript string is zero or more characters written inside quotes. Example let text = "John Doe"; You can use single or do…
JavaScript Numbers
JavaScript Dates
Example const cars = ["Saab", "Volvo", "BMW"]; An Array is an object type designed for storing data collections. Key characteristics of JavaScript arrays are: Elements : An array is a list of values,…
A JavaScript Set is a collection of unique values. Each value can only occur once in a Set. The values can be of any type, primitive values or objects. How to Create a Set You can create a JavaScript…
The Map Object A JavaScript Map is an object that can store collections of key-value pairs, similar to a dictionary in other programming languages. Maps differ from standard objects in that keys can…
JavaScript Math Object
Regular Expressions A Regular Expression is a sequence of characters that forms a search pattern. Regex is a common shorthand for a regular expression. RegExp is an Object for handling Regular Expres…
String Templates Template Strings Template Literals Beloved child has many names Back-Tics Syntax Template Strings use back-ticks (``) rather than the quotes ("") to define a string: Example let text…
Basic Methods Basic number methods can be used on any number toString() toExponential() toFixed() toPrecision() valueOf() Static Methods Static methods can only be used on Number Number.isFinite() Nu…
JavaScript Date Input There are generally 3 types of JavaScript date input formats: Type Example ISO Date "2015-03-25" (The International Standard) Short Date "03/25/2015" Long Date "Mar 25 2015" or…
JavaScript Array Methods
Set Methods & Properties new Set() add() clear() delete() entries() forEach() has() keys() values() size The new Set() Method Pass an array to the new Set() constructor: Example // Create a new Set c…
The new Map() Method You can create a map by passing an array to the new Map() constructor: Example // Create a Map const fruits = new Map([ ["apples", 500], ["bananas", 300], ["oranges", 200] ]); Ma…
Complete Math Reference Revised July 2025 Name Description abs(x) Returns the absolute value of x acos(x) Returns the arccosine of x, in radians acosh(x) Returns the hyperbolic arccosine of x asin(x)…
RegExp Modifier Flags Flags are parameters that can modify how a regex pattern is used, such as making it case-insensitive or global. /pattern/ flags JavaScript Regex Flags Revised July 2025 Flag Des…
Basic String Methods Javascript strings are primitive and immutable: All string methods produce a new string without altering the original string. String length String charAt() String charCodeAt() St…
Number Properties Number.EPSILON Number.MAX_VALUE Number.MIN_VALUE Number.MAX_SAFE_INTEGER Number.MIN_SAFE_INTEGER Number.POSITIVE_INFINITY Number.NEGATIVE_INFINITY Number.NaN See Also: Numbers Tutor…
The new Date() Constructor In JavaScript, date objects are created with new Date(). new Date() returns a date object with the current date and time. Get the Current Time const date = new Date(); Date…
Array Search Methods Array indexOf() Array lastIndexOf() Array includes() Array find() Array findIndex() Array findLast() Array findLastIndex() Complete JavaScript Array Reference See Also: JavaScrip…
Logic Set Methods In JavaScript 2025, 7 new logical methods were added to the Set object: union() difference() intersection() isDisjointFrom() isSubsetOf() isSupersetOf() symmetricDifference() Browse…
The WeakMap Object A JavaScript WeakMap is a collection of key/value pairs where the keys must be objects. A WeakMap holds weak references to its keys. Example // Create a WeakMap let myMap = new Wea…
Example // Returns a random number: Math.random(); JavaScript Math.random() Math.random() returns a random number between 0 (inclusive), and 1 (exclusive): Math.random() always returns a number lower…
Character Classes are characters enclosed in square brackets []. A character class matches any character from a set within brackets: // Match Digits const pattern = /[0-9]/; JavaScript Regex Characte…
String Search Methods String indexOf() String lastIndexOf() String search() String match() String matchAll() String includes() String startsWith() String endsWith() See Also: String Tutorial String M…
Complete Number Reference Revised July 2025 Name Description constructor Returns the function that created JavaScript's Number prototype EPSILON Returns the difference between 1 and the smallest numb…
Set Date methods let you set date values (years, months, days, hours, minutes, seconds, milliseconds) for a Date Object. Set Date Methods Set Date methods are used for setting a part of a date: Metho…
Alphabetic Sort Array sort() Array reverse () Array toSorted() Array toReversed() Sorting Objects Numeric Sort Numeric Sort Random Sort Math.min() Math.max() Home made Min() Home made Max() Complete…
The WeakSet Object A JavaScript WeakSet is a collection of values where the values must be objects. A WeakSet holds weak references to its values. Examples // Create a WeakSet let mySet = new WeakSet…
Complete Map Reference Revised July 2025 Method Description new Map() Creates a new Map object clear() Removes all the elements from a Map delete() Removes a Map element specified by a key entries()…
Regular Expression Metacharacters Metacharacters are characters with a special meaning. They can be used to match digts, words, spaces, and more: // Match words const pattern = /\w/; JavaScript Regex…
Complete String Reference Revised July 2025 Name Description at() Returns an indexed character from a string charAt() Returns the character at a specified index (position) charCodeAt() Returns the Un…
JavaScript Bitwise Operators Operator Name Description & AND Sets each bit to 1 if both bits are 1 | OR Sets each bit to 1 if one of two bits is 1 ^ XOR Sets each bit to 1 if only one of two bits is…
JavaScript Date Methods and Properties Revised April 2026 Name Description new Date() Creates a new Date object constructor Creates a new Date object constructor Returns the function that created the…
Array Iteration Methods Array iteration methods operate on every array item. Array forEach Array map() Array flatMap() Array filter() Array reduce() Array reduceRight() Array every() Array some() Arr…
Complete Set Reference Revised July 2025 Method Description new Set() Creates a new set add() Adds a new element to a set clear() Removes all elements from a set delete() Removes an element from a se…
RegExp Assertions Assertions matches Boundaries and Lookarounds String Boundaries and Word Boundaries. Lookarounds: Lookaheads and Lookbehinds. // Match beginning of string const pattern = /^W3School…
JavaScript BigInt
Complete Array Reference Revised July 2025 Name Description [ ] Creates a new Array new Array() Creates a new Array at() Returns an indexed element of an array concat() Joins arrays and returns an ar…
RegExp Quantifiers Quantifiers define the numbers of characters or expressions to match. // Match at least one zero const pattern = /0+/; JavaScript RexExp Quantifiers Revised July 2025 Code Descript…
ECMAScript 2015 (ES6) In 2015, JavaScript introduced an important new keyword: const. It has become a common practice to declare arrays using const Example const cars = ["Saab", "Volvo", "BMW"]; Cann…
Full RegExp Flag Reference Revised July 2025 Flags can be added to a regexp pattern to Modify its behavior: Flag Description /d Performs substring matches (new 2022) /g Performs a global match (find…
The RegExp Object In JavaScript, RegExp is a regular expression object with predefined properties and methods. Using test() The test() method is a RegExp expression method. It searches a string for a…
Complete RexExp Reference Revised July 2025 Name Description compile() Compiles a regular expression (Deprecated) constructor Returns the function that created the RegExp prototype dotAll Returns tru…