Home/Exercises/Foundations
exercise set · 73 challenges · beginner to hard

JavaScript Fundamentals Exercises for Beginners

Build a strong foundation with beginner JavaScript exercises covering variables, operators, strings, conditionals, loops, functions, arrays, and objects. Write code in your browser and get instant feedback with no setup.

Choose your next challenge

Exercises

Work from beginner to hard, or use the filters to find a specific skill.

73exercises
About this practice set

Build a practical JavaScript foundation

These JavaScript fundamentals exercises turn core language concepts into small coding decisions you can practice, test, and revisit. Start with variables and values, then work through operators, strings, conditional logic, loops, functions, arrays, and objects.

The collection progresses from beginner JavaScript exercises to more challenging practice problems. You'll predict output, complete code, repair common mistakes, and solve focused programming tasks, helping you understand not only the syntax but why JavaScript behaves the way it does.

Consistent hands-on JavaScript practice builds the mental models you need to debug code and move into DOM, browser, and asynchronous programming with more confidence.

Exercises
73
Difficulty
Beginner to Hard
Good to know first
No professional programming experience required; start with the beginner exercises on variables and values.
Start with Name a Fixed Value

What you’ll practice

  • Declare variables and choose between let and const
  • Work with strings, numbers, booleans, and empty values
  • Use arithmetic, comparison, and logical operators
  • Control programs with if, else, ternaries, and switch
  • Repeat tasks with for, while, and for...of loops
  • Write functions and understand variable scope
  • Read and update JavaScript arrays and objects
  • Find common logic, mutation, and off-by-one mistakes

Who these exercises are for

This JavaScript practice collection is for people learning JavaScript for the first time, students reinforcing a course, and developers refreshing the core language. Begin with the first exercises or use the filters to revisit a specific skill.

How practice works

  • Write and run JavaScript directly in your browser
  • Use instant test feedback to understand incorrect results
  • Progress by difficulty or filter exercises by topic
  • Sign in when you want to save your progress