Practice

Type the solution in the editor and hit Run. Reveal the official solution when you're stuck.

Print numbers 1 to 10

Easy

Use a for loop to log 1, 2, 3 … 10 to the console.

Try it yourself
Console
Click Run to see output.

Even or Odd

Easy

Write a function isEven(n) that returns 'even' or 'odd'.

Try it yourself
Console
Click Run to see output.

Largest of 3 numbers

Easy

Return the biggest of three numbers without using Math.max.

Try it yourself
Console
Click Run to see output.

Reverse a string

Easy

Reverse 'javascript' → 'tpircsavaj'.

Try it yourself
Console
Click Run to see output.

Count vowels

Medium

Count how many vowels (a,e,i,o,u) appear in a sentence (case-insensitive).

Try it yourself
Console
Click Run to see output.

Find duplicates in array

Medium

Return a unique list of values that appear more than once.

Try it yourself
Console
Click Run to see output.

Mini calculator function

Medium

Write calc(a, op, b) supporting +, -, *, /.

Try it yourself
Console
Click Run to see output.

Validate email

Medium

Return true if the string looks like an email (simple check).

Try it yourself
Console
Click Run to see output.

FizzBuzz (1 to 30)

Hard

Print Fizz for multiples of 3, Buzz for 5, FizzBuzz for both, else the number.

Try it yourself
Console
Click Run to see output.

Palindrome check

Hard

Ignore case and non-letters. 'A man, a plan, a canal: Panama' → true.

Try it yourself
Console
Click Run to see output.

Debounce a function

Hard

Wrap fn so it only runs after the user stops calling it for `wait` ms.

Try it yourself
Console
Click Run to see output.