bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/JavaScript

JavaScript

Working with Data

Strings, numbers, arrays, maps, sets, dates, regex, and the built-ins you use every day.

Lesson 1visual

JavaScript Strings

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…

3 min
Read lesson →
Lesson 2visual

JavaScript Numbers

JavaScript Numbers

6 min
Read lesson →
Lesson 3visual

JavaScript Dates

JavaScript Dates

4 min
Read lesson →
Lesson 4visual

JavaScript Arrays

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,…

8 min
Read lesson →
Lesson 5visual

JavaScript Sets

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…

2 min
Read lesson →
Lesson 6visual

JavaScript Maps

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…

2 min
Read lesson →
Lesson 7visual

JavaScript Math Object

JavaScript Math Object

3 min
Read lesson →
Lesson 8

JavaScript RegExp

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…

5 min
Read lesson →
Lesson 9visual

JavaScript String Templates

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…

2 min
Read lesson →
Lesson 10visual

JavaScript Number Methods

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…

6 min
Read lesson →
Lesson 11visual

JavaScript Date Formats

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…

3 min
Read lesson →
Lesson 12visual

JavaScript Array Methods

JavaScript Array Methods

9 min
Read lesson →
Lesson 13visual

JavaScript Set 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…

3 min
Read lesson →
Lesson 14visual

JavaScript Map Methods

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…

3 min
Read lesson →
Lesson 15visual

JavaScript Math Reference

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)…

2 min
Read lesson →
Lesson 16

JavaScript RegExp Flags

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…

6 min
Read lesson →
Lesson 17visual

JavaScript String Methods

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…

11 min
Read lesson →
Lesson 18visual

JavaScript Number Properties

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…

2 min
Read lesson →
Lesson 19visual

JavaScript Get Date Methods

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…

4 min
Read lesson →
Lesson 20visual

JavaScript Array Search

Array Search Methods Array indexOf() Array lastIndexOf() Array includes() Array find() Array findIndex() Array findLast() Array findLastIndex() Complete JavaScript Array Reference See Also: JavaScrip…

4 min
Read lesson →
Lesson 21visual

JavaScript Set Logic

Logic Set Methods In JavaScript 2025, 7 new logical methods were added to the Set object: union() difference() intersection() isDisjointFrom() isSubsetOf() isSupersetOf() symmetricDifference() Browse…

2 min
Read lesson →
Lesson 22visual

JavaScript WeakMap

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…

4 min
Read lesson →
Lesson 23

JavaScript Random

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…

2 min
Read lesson →
Lesson 24

RegExp Character Classes

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…

2 min
Read lesson →
Lesson 25visual

JavaScript String Search

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…

4 min
Read lesson →
Lesson 26visual

JavaScript Number Reference

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…

2 min
Read lesson →
Lesson 27visual

JavaScript Set Date Methods

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…

2 min
Read lesson →
Lesson 28visual

JavaScript Array Sort

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…

7 min
Read lesson →
Lesson 29visual

JavaScript WeakSet

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…

3 min
Read lesson →
Lesson 30visual

JavaScript Map Reference

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()…

2 min
Read lesson →
Lesson 31

RegExp Meta Characters

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…

3 min
Read lesson →
Lesson 32visual

JavaScript String Reference

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…

3 min
Read lesson →
Lesson 33

JavaScript Bitwise Operations

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…

6 min
Read lesson →
Lesson 34visual

JavaScript Date Reference

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…

3 min
Read lesson →
Lesson 35visual

JavaScript Array Iterations

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…

9 min
Read lesson →
Lesson 36visual

JavaScript Set Reference

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…

2 min
Read lesson →
Lesson 37

Regular Expression Assertions

RegExp Assertions Assertions matches Boundaries and Lookarounds String Boundaries and Word Boundaries. Lookarounds: Lookaheads and Lookbehinds. // Match beginning of string const pattern = /^W3School…

5 min
Read lesson →
Lesson 38visual

JavaScript BigInt

JavaScript BigInt

5 min
Read lesson →
Lesson 39visual

JavaScript Array Reference

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…

3 min
Read lesson →
Lesson 40

RegExp Quantifiers

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…

2 min
Read lesson →
Lesson 41visual

JavaScript Array Const

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…

3 min
Read lesson →
Lesson 42visual

JavaScript RegExp Patterns

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…

3 min
Read lesson →
Lesson 43

JavaScript RegExp Objects

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…

2 min
Read lesson →
Lesson 44visual

RegExp Methods

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…

2 min
Read lesson →