The JavaScript algorithms collection includes implementations and examples of popular algorithms in ES6. Algorithmic snippets are primarily a learning resource, as they might already be implemented natively or require optimizations to run in production.
Sorts an array of numbers, using the merge sort algorithm.
JavaScript, Algorithm · Dec 27, 2020
Creates an array of numbers in the arithmetic progression, starting with the given positive integer and up to the specified limit.
JavaScript, Math · Oct 13, 2021
Sorts an array of numbers, using the bubble sort algorithm.
JavaScript, Algorithm · Dec 29, 2020
Calculates the greatest common divisor between two or more numbers/arrays.
JavaScript, Math · Dec 29, 2020
Sorts an array of numbers, using the insertion sort algorithm.
JavaScript, Algorithm · Dec 28, 2020
Initializes an array containing the numbers in the specified geometric progression range.
JavaScript, Math · Dec 28, 2020
Finds the index of a given element in a sorted array using the binary search algorithm.
JavaScript, Algorithm · Dec 29, 2020
Calculates the difference between two strings, using the Levenshtein distance algorithm.
JavaScript, String · Dec 29, 2020
Generates an array, containing the Fibonacci sequence, up until the nth term.
JavaScript, Math · Dec 28, 2020
Finds the first index of a given element in an array using the linear search algorithm.
JavaScript, Algorithm · Dec 28, 2020
Finds the prime factors of a given number using the trial division algorithm.
JavaScript, Math · Dec 28, 2020
Calculates the least common multiple of two or more numbers.
JavaScript, Math · Dec 28, 2020
Randomizes the order of the values of an array, returning a new array.
JavaScript, Array · Feb 20, 2021