JavaScript coding challenges

340 challenges you can solve in JavaScript, from first loops to graphs, dynamic programming and machine learning. Write your code in the browser, run the tests instantly and get an AI review.

Easy · 193 Medium · 118 Hard · 29

Skills you'll practise: Nested loopsDigit extractionCountingLoopsString splittingConditionsSieve of Eratosthenes2D listsArithmeticBig number arithmeticCycle detectionDivisibility
  • Python · C++ · C#
  • Automated tests
  • AI code review
  • Community solutions
341
Challenges
245
Solutions shared
9
Languages

All challenges

Search by name or topic, or filter by difficulty.

340 challenges
Medium

Highly Divisible Triangular Number

Find the first triangular number that has at least d divisors.

You'll learn Prime factorizationDivisor counting
Competitive-programmingIntermediateNumber-theoryProject Euler stylemath
No solutions yet
Easy

Middle Item

Read numbers up to a negative sentinel and return the middle one.

You'll learn Sentinel valuesList indexing
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Password Modifier

Strengthen a password by swapping some letters for symbols and adding its length at the end.

You'll learn Character replacementString building
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Simple Statistics

Return the minimum, maximum and average of a list of whole numbers.

You'll learn AccumulatorsRunning minimum and maximum
BeginnerCS1ConditionsFunctionsHomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Happy Number

Decide whether repeatedly summing the squares of the digits of a number reaches 1.

You'll learn Digit extractionCycle detection
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Medium

Hourglass Pattern

Print an hourglass of stars: an inverted pyramid on top of an upright one, sharing the single-star waist.

You'll learn Nested loopsSymmetry
CS1High schoolIntermediateLoopsNested-loopsPatterns
No solutions yet
Easy

Strong Number

Check whether a number equals the sum of the factorials of its digits.

You'll learn Digit extractionFactorials
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Contains the Character

Keep only the words that contain a given letter, ignoring case.

You'll learn Case-insensitive comparisonFiltering a list
BeginnerCS1HomeworkIntro programmingStudent-beginner
No solutions yet
Medium

Kaprekar Number

Check whether the square of a d-digit number splits into a left part and a d-digit right part that add up to the number.

You'll learn Splitting numbersPowers of ten
CS1High schoolIntermediateLoopsNumbersmath
No solutions yet
Easy

Automorphic Number

Check whether the square of a number ends with the number itself.

You'll learn Digit comparisonPowers of ten
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Harshad Number

Check whether a number is divisible by the sum of its digits (a Harshad or Niven number).

You'll learn Digit sumDivisibility
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Disarium Number

Check whether a number equals the sum of its digits raised to their positions.

You'll learn Digit positionsInteger powers
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Gradebook Letter Counts

Turn a whole class's scores into letter grades and count how many students got each letter.

You'll learn If-else chainsCounting with an array
BeginnerCS1HomeworkIntro programmingStudent-beginner
No solutions yet
Easy

Spy Number

Check whether the sum of a number's digits equals the product of its digits.

You'll learn Digit sumDigit product
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet
Easy

Alphabet Triangle

Print a right triangle of letters where row i spells the first i letters of the alphabet.

You'll learn Nested loopsCharacter codes
BeginnerCS1High schoolLoopsNested-loopsPatterns
No solutions yet
Easy

Neon Number

Check whether the digit sum of a number's square equals the number.

You'll learn Digit sumSquaring
BeginnerCS1High schoolLoopsNumbersmath
No solutions yet