ErrLookup › TheAlgorithms/JavaScript

TheAlgorithms/JavaScript

Algorithms and Data Structures implemented in JavaScript for beginners, following best practices. · JavaScript · 380 source files

Analyzed at 5c39e87a9a on 2026-08-13. 130 documented errors.

Code / MessageTypeSeverityTags
The two parameters must be distinct, non-null integers
exception error validation, number-theory, integer, input-validation, friendly-numbers
The second param should be a boolean
exception error string, validation, type-guard, boolean, word-count
The should be type Number
exception error type-check, input-validation, numeric, typeof
Invalid keyword!
validation error cipher, keyword-shifted, input-validation, bug, duplicate-characters
n cannot be a floating point number
exception error validation, integer, numeric, floating-point
Type of n must be number
exception error type-check, input-validation, numeric, automorphic
Invalid Triangle sides.
exception error geometry, validation, triangle-inequality, input-validation
Unsupported base. Must be in range [2, 10]
exception error range-error, numeric-base, input-validation, radix
location should point to a pixel within the rgbData
exception error bounds-check, image-processing, flood-fill, input-validation
The only accepts non-negative values
exception error validation, numeric, negative-value, geometry
Invalid phone number!
exception error string, validation, phone-number, formatting, coercion-bug
Not a Number
exception error type-check, input-validation, numeric, gcd, number-theory
Index out of range
exception error validation, array, index-out-of-bounds, recursion, off-by-one
Arguments must be numbers
exception error type-check, input-validation, numeric, gcd, number-theory
Only string arguments are allowed
validation error type-validation, string, base-conversion, typeof, conversions
Invalid Input
exception error type-check, input-validation, numeric, taylor-series, nan
One of the items in your array is not a number
exception error type-check, sort, numeric, input-validation
Strings must be of the same length
exception error string, validation, hamming-distance, length-mismatch
Email Address String Null or Empty.
validation warning string, validation, email, type-check, input-validation
Expected integer N and finite a, b
exception error math, calculus, type-validation, numerical-integration
Index out of bounds. The maximum index can be length-1
exception error bounds-check, union-find, off-by-one, input-validation
Argument is not a number.
exception error type-check, input-validation, numeric, krishnamurthy
Array is empty
exception warning validation, variadic, empty-input, array, edge-case
Input is not a valid 2D matrix.
exception error validation, matrix, array, linear-algebra, input-validation
Number must be greater than zero.
exception error math, number-theory, precondition, prime-factorization
canvasWidth should be greater than zero
exception error input-validation, geometry, canvas, positive-number
Duplicate characters in character set are not allowed
validation error validation, base-conversion, unique-keys, charset, conversions
Square matrix is required.
exception error validation, matrix, square-matrix, linear-algebra
The given value is not a string
exception error type-check, string, pangram, regex, input-validation
Input data must be strings
validation error string, validation, type-guard, percentage, nan-risk
Index is out of range max
exception error data-structures, linked-list, range-error, index-bounds, circular-list
Invalid number range, please provide numbers such that num1…
exception warning validation, range, ordering, numeric
The arg must be a valid, non empty string
validation error string, validation, type-check, input-validation
Argument is not a string.
exception error string, validation, type-guard, naming-convention
Input cannot be a Decimal
exception error math, aliquot-sum, type-error, integer-validation
Invalid date format. Please use 'dd/mm/yyyy'.
validation error date, validation, format, regex, input-validation
Input must not contain special characters
exception error string, validation, regex, letter-count, ascii-only
key has to be a function or else left undefined
exception error type-check, union-find, constructor, input-validation
Expected a number, received
exception error type-validation, math, optional-parameter, default-parameter
Please provide number greater that 1
exception error range-validation, project-euler, typo-message, boundary
Invalid input, please pass only numbers
exception error type-check, input-validation, numeric, range
Invalid Month Number.
validation error date, validation, off-by-one, type-check, input-validation
Argument should be a string
exception error string, validation, type-guard, max-character
Invalid day value.
validation error date, validation, business-rule, input-validation
Dimension must be odd
exception error range-validation, project-euler, parity, spiral
Input cannot be Negative
exception error math, aliquot-sum, type-error, negative-input
Invalid arguments
exception error bounds-check, search, quickselect, input-validation
Invalid input, please provide valid number
exception error input-validation, project-euler, parse-pitfall, loose-check
Please input a valid list or array.
exception error type-check, sort, recursion, input-validation
Subarray size k must be between 1 and the length of the…
exception error range-check, sliding-window, input-validation
Modulus must be initialized in the object constructor
exception error math, object-state, precondition, modular-arithmetic
The geometric progression is diverging, and its sum cannot…
exception error math, domain-validation, infinite-series, convergence
All of the inputs of the array must be positive.
exception error dynamic-programming, subset-sum, validation, positive-integers
Not a valid character
validation error validation, base-conversion, charset, out-of-range, conversions
Input data must be numbers
exception error type-validation, math, binary-search, nan-pitfall
The should be Number type
exception error type-validation, math, geometry, shared-helper
Argument is NaN - Not a Number
exception error math, abs, type-error, nan, input-coercion
is an invalid credit card number because it has…
validation error string, validation, credit-card, sanitization, input-validation
The value of latitude or longitude should be a number
exception error type-validation, navigation, geo, haversine
Input data must be type of Array
exception error dynamic-programming, grid, type-guard, input-shape
Argument should be string
exception error type-check, string, palindrome, input-validation
Argument is not a valid HEX code!
validation error validation, hex, regex, input-sanitization, conversions
Invalid hex string.
validation error validation, hex, regex, case-sensitivity, conversions
Input must be a integer number
exception error type-validation, math, palindrome, misleading-message
Input must not contain numbers
exception error string, validation, regex, letter-count, ascii-only
Rule must be an integer between the values 0 and 255
validation error cellular-automata, rule-validation, type-validation, integer
No natural numbers exist below 1
exception error range-validation, project-euler, math, natural-number
The only accepts positive values
exception error range-validation, math, geometry, positive-value
is not coprime of 26
validation error cipher, affine, math, coprime, modular-inverse
Capacity should be greater than 0
validation error cache, lru, capacity, range-validation
Fibonacci sequence limit can't be less than 1
exception error range-validation, project-euler, math, fibonacci
The param should be a nonempty string
exception error string, validation, empty-input, max-character
is an invalid credit card number because it fails the Luhn…
validation error validation, credit-card, luhn, checksum, business-rule
is an invalid credit card number because of its first two…
validation error validation, credit-card, business-rule, issuer-detection
Input should be a non-negative whole number
exception error range-validation, recursion, math, integer-only
Expected a valid real number
exception error math, input-validation, type-guard, number-theory
is an invalid credit card number because of its length.
validation error validation, credit-card, business-rule, input-validation
Both arguments should be strings.
exception error type-check, string, anagram, input-validation
Stack Underflow
exception error data-structures, stack, underflow, lifo
Given input is not an array
exception error type-check, sort, input-validation
Improper string encoding
exception error dynamic-programming, date-parsing, input-format, calendar
Invalid capacity
validation error cache, lru, capacity, constructor, type-validation
Index Out of Bound
validation error validation, range-check, index, quickselect, data-structures, off-by-one
Input is not a valid RGB color.
validation error validation, rgb, hsl, color, range-check, conversions
Triplet cannot exist with the given array
exception error dynamic-programming, array, input-size, product
Error size should be less than equal to 32
validation error bit-manipulation, power-set, range-validation, performance
Input must be a string or a number
exception error string, validation, type-guard, palindrome, number
Argument is not a string
exception error type-check, string, ascii, input-validation
Arguments are invalid
validation error cipher, caesar, type-validation, range-validation
hue should be between 0 and 360
validation error validation, hsv, rgb, color, range-check, conversions
Minimum of 3 points is required to form closed polygon!
exception error geometry, convex-hull, input-size, polygon
maxStep should be greater than zero
exception error math, rendering, precondition, fractal
Arguments type are invalid
validation error cipher, xor, type-validation, integer
Invalid units
validation error validation, units, length, lookup, conversions
Input should be integer
exception error dynamic-programming, fibonacci, type-error, integer-validation
The first param should be a string
exception error string, validation, type-guard, word-count
Cannot normalize vectors of length 0
exception error math, vector, divide-by-zero, geometry
Coefficient a, b should be number
validation error cipher, affine, type-validation, coefficient
Grid must be a square
validation error backtracking, maze, grid, dimension-validation
The two lists must be of equal length
exception error math, statistics, input-validation, ml