JS Tutorial

Js versions, js functions, js html dom, js browser bom, js web apis, js vs jquery, js graphics, js examples, js references, javascript exercises.

You can test your JavaScript skills with W3Schools' Exercises.

We have gathered a variety of JavaScript exercises (with answers) for each JavaScript Chapter.

Try to solve an exercise by editing some code, or show the answer to see what you've done wrong.

Count Your Score

You will get 1 point for each correct answer. Your score and total score will always be displayed.

Start JavaScript Exercises

Start JavaScript Exercises ❯

If you don't know JavaScript, we suggest that you read our JavaScript Tutorial from scratch.

Kickstart your career

Get certified by completing the course

Get Certified

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

  • DSA with JS - Self Paced
  • JS Tutorial
  • JS Exercise
  • JS Interview Questions
  • JS Operator
  • JS Projects
  • JS Examples
  • JS Free JS Course
  • JS A to Z Guide
  • JS Formatter
  • JavaScript Tutorial

JavaScript Basics

  • Introduction to JavaScript
  • JavaScript Versions
  • How to Add JavaScript in HTML Document?
  • JavaScript Statements
  • JavaScript Syntax
  • JavaScript Output
  • JavaScript Comments

JS Variables & Datatypes

  • Variables and Datatypes in JavaScript
  • Global and Local variables in JavaScript
  • JavaScript Let
  • JavaScript Const
  • JavaScript var

JS Operators

  • JavaScript Operators
  • Operator precedence in JavaScript
  • JavaScript Arithmetic Operators
  • JavaScript Assignment Operators
  • JavaScript Comparison Operators
  • JavaScript Logical Operators
  • JavaScript Bitwise Operators
  • JavaScript Ternary Operator
  • JavaScript Comma Operator
  • JavaScript Unary Operators
  • JavaScript Relational operators
  • JavaScript String Operators
  • JavaScript Loops
  • 7 Loops of JavaScript
  • JavaScript For Loop
  • JavaScript While Loop
  • JavaScript for-in Loop
  • JavaScript for...of Loop
  • JavaScript do...while Loop

JS Perfomance & Debugging

  • JavaScript | Performance
  • Debugging in JavaScript
  • JavaScript Errors Throw and Try to Catch
  • Objects in Javascript
  • Introduction to Object Oriented Programming in JavaScript
  • JavaScript Objects
  • Creating objects in JavaScript (4 Different Ways)
  • JavaScript JSON Objects
  • JavaScript Object Reference

JS Function

  • Functions in JavaScript
  • How to write a function in JavaScript ?
  • JavaScript Function Call
  • Different ways of writing functions in JavaScript
  • Difference between Methods and Functions in JavaScript
  • Explain the Different Function States in JavaScript
  • JavaScript Function Complete Reference
  • JavaScript Arrays
  • JavaScript Array Methods
  • Best-Known JavaScript Array Methods
  • What are the Important Array Methods of JavaScript ?
  • JavaScript Array Reference
  • JavaScript Strings
  • JavaScript String Methods
  • JavaScript String Reference
  • JavaScript Numbers
  • How numbers are stored in JavaScript ?
  • How to create a Number object using JavaScript ?
  • JavaScript Number Reference
  • JavaScript Math Object
  • What is the use of Math object in JavaScript ?
  • JavaScript Math Reference
  • JavaScript Map
  • What is JavaScript Map and how to use it ?
  • JavaScript Map Reference
  • Sets in JavaScript
  • How are elements ordered in a Set in JavaScript ?
  • How to iterate over Set elements in JavaScript ?
  • How to sort a set in JavaScript ?
  • JavaScript Set Reference
  • JavaScript Date
  • JavaScript Promise
  • JavaScript BigInt
  • JavaScript Boolean
  • JavaScript Proxy/Handler
  • JavaScript WeakMap
  • JavaScript WeakSet
  • JavaScript Function Generator
  • JavaScript JSON
  • Arrow functions in JavaScript
  • JavaScript this Keyword
  • Strict mode in JavaScript
  • Introduction to ES6
  • JavaScript Hoisting
  • Async and Await in JavaScript

JavaScript Exercises

Javascript exercises, practice questions and solutions.

If you are a JavaScript learner, then Practice JavaScript Online (JavaScript Exercises) by solving JavaScript quizzes, track progress, and enhance coding skills with our engaging portal. These JavaScript practice questions are ideal for beginners and experienced developers. So, to test your skills, go through these JavaScript exercises with solutions.

A step-by-step JavaScript practice guide for beginner to advanced level.

Benefits of Practice JavaScript

  • Interactive Quizzes: Engage in hands-on JavaScript quizzes.
  • Progress Tracking: Monitor your learning journey.
  • Skill Enhancement: Sharpen coding skills effectively.
  • Flexible Learning: Practice at your own pace.
  • Immediate Feedback: Receive instant results and feedback.
  • Convenient Accessibility: Accessible online, anytime.
  • Real-world Application: Apply JavaScript concepts practically.
  • Comprehensive Learning: Cover a range of JavaScript topics.

How to Start Practice ?

Embark on your JavaScript learning journey with our online practice portal. Start by selecting quizzes tailored to your skill level. Engage in hands-on coding exercises, receive real-time feedback, and monitor your progress. With our user-friendly platform, mastering JavaScript becomes an enjoyable and personalized experience. Elevate your coding expertise today.

JavaScript Best Practice Guide

Dive into JavaScript excellence with our Best Practice Guide. Explore coding standards, optimization techniques, and industry-recommended approaches. Elevate your skills through insightful tips, real-world examples, and interactive challenges. Unlock the secrets of efficient and maintainable JavaScript coding, ensuring your projects stand out with clarity and performance.

Why Practice JavaScript Online ?

Elevate your JavaScript online test experience with categorized fill-in-the-blank questions. This structured format guides your learning, providing targeted challenges for hands-on improvement. Engage in focused practice as it reinforce coding concepts, receive instant feedback, and enhance your skills incrementally. Moreover, by combining theoretical understanding with practical application, you’ll enjoy a comprehensive and effective approach to mastering JavaScript and as a result optimizing your performance in real-world scenarios.

JavaScript online practice Rules

  • Be Honest: Complete challenges independently, refrain from plagiarism or seeking unauthorized help.
  • Manage Time: Adhere to assessment time limits, simulating real-world scenarios.
  • Code Quality : Prioritize clean, efficient, and well-documented code.
  • Follow Guidelines : Adhere to platform-specific instructions, including input/output formats and code submission procedures.
  • No Cheating: Avoid external resources during assessments, unless explicitly allowed.
  • Utilize Feedback: Learn from automated or mentor/community feedback.
  • Participate Actively: Engage in forums, discussions, and share insights with fellow learners.
  • Continuous Improvement: Use assessments to identify and improve areas of weakness for ongoing growth.

Features of Practice Portal

  • Instant Mistake Correction: Receive immediate feedback on errors to facilitate quick learning.
  • Unlimited Tries: Allow learners to attempt questions multiple times for mastery.
  • Time Display for Each Category: Show elapsed time for each set of 5-6 fill-in-the-blank questions to manage time effectively.
  • Table View of Scenarios: Provide a comprehensive table view displaying all categories, their status (completed or pending), and corresponding scores.
  • Performance Analytics: Track progress with detailed analytics, highlighting strengths and areas for improvement.
  • Interactive Code Editor: Offer a responsive code editor for an immersive hands-on experience.
  • Hints and Solutions: Include hints for guidance and solutions to foster self-learning.
  • Community Integration: Facilitate collaboration through forums and discussions for peer learning.
  • Adaptive Difficulty: Adjust difficulty levels based on user performance for personalized challenges.
  • Gamification Elements: Incorporate scoring, achievements, or badges to make learning engaging.

Please Login to comment...

Similar reads.

  • WebTech - Exercises
  • Web Technologies

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

Uploaded avatar of ghjk

Practice 147 exercises in JavaScript

Learn and practice JavaScript by completing 147 exercises that explore different concepts and ideas.

Explore the JavaScript exercises on Exercism

Unlock more exercises as you progress. They’re great practice and fun to do!

40 JavaScript Projects for Beginners – Easy Ideas to Get Started Coding JS

Jessica Wilkins

The best way to learn a new programming language is to build projects.

I have created a list of 40 beginner friendly project tutorials in Vanilla JavaScript, React, and TypeScript.

My advice for tutorials would be to watch the video, build the project, break it apart and rebuild it your own way. Experiment with adding new features or using different methods.

That will test if you have really learned the concepts or not.

You can click on any of the projects listed below to jump to that section of the article.

Vanilla JavaScript Projects

How to create a color flipper.

  • How to create a counter
  • How to create a review carousel
  • How to create a responsive navbar
  • How to create a sidebar
  • How to create a modal

How to create a FAQ page

How to create a restaurant menu page, how to create a video background, how to create a navigation bar on scroll, how to create tabs that display different content, how to create a countdown clock, how to create your own lorem ipsum, how to create a grocery list, how to create an image slider, how to create a rock paper scissors game, how to create a simon game, how to create a platformer game.

  • How to create Doodle Jump
  • How to create Flappy Bird
  • How to create a Memory game
  • How to create a Whack-a-mole game
  • How to create Connect Four game
  • How to create a Snake game
  • How to create a Space Invaders game
  • How to create a Frogger game
  • How to create a Tetris game

React Projects

How to build a tic-tac-toe game using react hooks, how to build a tetris game using react hooks, how to create a birthday reminder app.

  • How to create a tours page

How to create an accordion menu

How to create tabs for a portfolio page, how to create a review slider, how to create a color generator, how to create a stripe payment menu page, how to create a shopping cart page, how to create a cocktail search page, typescript projects, how to build a quiz app with react and typescript, how to create an arkanoid game with typescript.

If you have not learned JavaScript fundamentals, then I would suggest watching this course before proceeding with the projects.

Many of the screenshots below are from here .

color-flipper

In this John Smilga tutorial , you will learn how to create a random background color changer. This is a good project to get you started working with the DOM.

In Leonardo Maldonado's article on why it is important to learn about the DOM, he states:

By manipulating the DOM, you have infinite possibilities. You can create applications that update the data of the page without needing a refresh. Also, you can create applications that are customizable by the user and then change the layout of the page without a refresh.

Key concepts covered:

  • document.getElementById()
  • document.querySelector()
  • addEventListener()
  • document.body.style.backgroundColor
  • Math.floor()
  • Math.random()
  • array.length

Before you get started, I would suggest watching the introduction where John goes over how to access the setup files for all of his projects.

How to create a Counter

counter

In this John Smilga tutorial , you will learn how to create a counter and write conditions that change the color based on positive or negative numbers displayed.

This project will give you more practice working with the DOM and you can use this simple counter in other projects like a pomodoro clock.

  • document.querySelectorAll()
  • currentTarget property
  • textContent

How to create a Review carousel

reviews

In this tutorial , you will learn how to create a carousel of reviews with a button that generates random reviews.

This is a good feature to have on an ecommerce site to display customer reviews or a personal portfolio to display client reviews.

  • DOMContentLoaded

How to create a responsive Navbar

navbar-1

In this tutorial , you will learn how to create a responsive navbar that will show the hamburger menu for smaller devices.

Learning how to develop responsive websites is an important part of being a web developer. This is a popular feature used on a lot of websites.

  • classList.toggle()

How to create a Sidebar

sidebar

In this tutorial , you will learn how to create a sidebar with animation.

This is a cool feature that you can add to your personal website.

  • classList.remove()

How to create a Modal

modal

In this tutorial , you will learn how to create a modal window which is used on websites to get users to do or see something specific.

A good example of a modal window would be if a user made changes in a site without saving them and tried to go to another page. You can create a modal window that warns them to save their changes or else that information will be lost.

  • classList.add()

FAQ-section

In this tutorial , you will learn how to create a frequently asked questions page which educates users about a business and drives traffic to the website through organic search results.    

menu

In this tutorial , you will learn how to make a restaurant menu page that filters through the different food menus. This is a fun project that will teach you higher order functions like map, reduce, and filter.

In Yazeed Bzadough's article on higher order functions, he states:

the greatest benefit of HOFs is greater reusability.
  • map, reduce, and filter
  • includes method

video-1

In this tutorial , you will learn how to make a video background with a play and pause feature.  This is a common feature found in a lot of websites.

  • classList.contains()

scroll-page

In this tutorial , you will learn how to create a navbar that slides down when scrolling and then stays at a fixed position at a certain height.

This is a popular feature found on many professional websites.

  • getFullYear()
  • getBoundingClientRect()
  • slice method
  • window.scrollTo()

tabs

In this tutorial , you will learn how to create tabs that will display different content which is useful when creating single page applications.

countdown

In this tutorial , you will learn how to make a countdown clock which can be used when a new product is coming out or a sale is about to end on an ecommerce site.

  • setInterval()
  • clearInterval()

lorem-ipsum

In this tutorial , you will learn how to create your own Lorem ipsum generator.

Lorem ipsum is the go to placeholder text for websites. This is a fun project to show off your creativity and create your own text.

  • event.preventDefault()

grocery-list

In this tutorial , you will learn how to update and delete items from a grocery list and create a simple CRUD (Create, Read, Update, and Delete) application.

CRUD plays a very important role in developing full stack applications. Without it, you wouldn't be able to do things like edit or delete posts on your favorite social media platform.  

  • createAttribute()
  • setAttributeNode()
  • appendChild()

image-slider

In this tutorial , you will learn how to build an image slider that you can add to any website.

  • querySelectorAll()
  • if/else statements

rock-paper-scissors

In this tutorial , Tenzin will teach you how to create a Rock Paper Scissors game. This is a fun project that will give more practice working with the DOM.

  • switch statements

simon-game

In this tutorial , Beau Carnes will teach you how to create the classic Simon Game. This is a good project that will get you thinking about the different components behind the game and how you would build out each of those functionalities.

  • querySelector()
  • setTimeout()

platformer-game

In this tutorial , Frank Poth will teach you how to build a platformer game. This project will introduce you to Object Oriented Programming principles and the Model, View, Controller software pattern.

  • this keyword
  • OOP principles
  • MVC pattern

How to create Doodle Jump and Flappy Bird

doodle-jump

In this video series , Ania Kubow will teach you how to build Doodle Jump and Flappy Bird .

Building games are a fun way to learn more about JavaScript and will cover many popular JavaScript methods.

  • createElement()
  • removeChild()
  • removeEventListener()

How to create seven classic games with Ania Kubow

7-js-games

You will have a lot of fun creating seven games in this course by Ania Kubow:

  • Memory Game
  • Whack-a-mole
  • Connect Four
  • Space Invaders
  • onclick event
  • arrow functions

If you are not familiar with React fundamentals, then I would suggest taking this course before proceeding with the projects.

tic-tac-game-1

In this freeCodeCamp article , Per Harald Borgen talks about Scrimba's Tic-Tac-Toe game tutorial led by Thomas Weibenfalk. You can view the video course on Scimba's YouTube Channel.

This is a good project to start getting comfortable with React basics and working with hooks.

  • import / export

react-tetris-1

In this tutorial , Thomas Weibenfalk will teach you how to build a Tetris game using React Hooks and styled components.

  • useEffect()
  • useCallback()
  • styled components

brithday-app

In this John Smilga course, you will learn how to create a birthday reminder app. This is a good project to start getting comfortable with React basics and working with hooks.

I would also suggest watching John's video on the startup files for this project.

How to create a Tours Page

tours-page

In this tutorial , you will learn how to create a tours page where the user can delete which tours they are not interested in.

This will give you practice with React hooks and the async/await pattern.

  • try...catch statement
  • async/await pattern

accordion-react

In this tutorial , you will learn how to create a questions and answers accordion menu. These menus can be helpful in revealing content to users in a progressive way.

  • React icons

tabs-portfolio-page-react

In this tutorial , you will learn how to create tabs for a mock portfolio page. Tabs are useful when you want to display different content in single page applications.

react-slider

In this tutorial , you will learn how to create a review slider that changes to a new review every few seconds.

This is a cool feature that you can incorporate into an ecommerce site or portfolio.

react-color-generator

In this tutorial , you will learn how to create a color generator. This is a good project to continue practicing working with hooks and setTimeout.

  • clearTimeout()

stripe-page

In this tutorial , you will learn how to create a Stripe payment menu page. This project will give you good practice on how to design a product landing page using React components.

  • useContext()

shopping-cart-page

In this tutorial , you will learn how to create a shopping cart page that updates and deletes items. This project will also be a good introduction to the useReducer hook.

  • <svg> elements
  • useReducer()

cocktails-page

In this tutorial , you will learn how to create a cocktail search page. This project will give you an introduction to how to use React router.

React router gives you the ability to create a navigation on your website and change views to different components like an about or contact page.

  • <Router>
  • <Switch>

If you are unfamiliar with TypeScript, then I would suggest watching this course before proceeding with this project.

quiz-app

In this tutorial , Thomas Weibenfalk will teach you how to build a quiz app with React and TypeScript. This is a good opportunity to practice the basics of TypeScript.

  • dangerouslySetInnerHTML

akrnoid-game

In this tutorial , Thomas Weibenfalk will teach you how to build the classic Arkanoid game in TypeScript. This is a good project that will give you practice working with the basic concepts for TypeScript.

  • HTMLCanvasElement

I hope you enjoy this list of 40 project tutorials in Vanilla JavaScript, React and TypeScript.

Happy coding!

I am a musician and a programmer.

If you read this far, thank the author to show them you care. Say Thanks

Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started

IMAGES

  1. JavaScript assignments for students

    javascript homework assignments

  2. Javascript: Homework Assignment #1: Data Types

    javascript homework assignments

  3. Homework: JavaScript Associative Arrays and Objects

    javascript homework assignments

  4. JavaScript I

    javascript homework assignments

  5. JavaScript Homework Assignment #20

    javascript homework assignments

  6. Online Javascript Assignment Help ,Get Online Javascript Assignment

    javascript homework assignments

VIDEO

  1. Week 4 coding assignment

  2. 1

  3. Javascript 17: Objects Homework 3

  4. #CIS133js wk01 Assignment 1 Demonstration

  5. 9.javascript assignments operators-بالعربي

  6. Homework 4: JavaScript Widgets and MVC

COMMENTS

  1. JavaScript Exercises

    We have gathered a variety of JavaScript exercises (with answers) for each JavaScript Chapter. Try to solve an exercise by editing some code, or show the answer to see what you've done wrong. Count Your Score. You will get 1 point for each correct answer. Your score and total score will always be displayed.

  2. JavaScript Exercises, Practice Questions and Solutions

    Last Updated : 08 Feb, 2024. If you are a JavaScript learner, then Practice JavaScript Online (JavaScript Exercises) by solving JavaScript quizzes, track progress, and enhance coding skills with our engaging portal. These JavaScript practice questions are ideal for beginners and experienced developers.

  3. JavaScript exercises on Exercism

    Practice 147 exercises in JavaScript. Learn and practice JavaScript by completing 147 exercises that explore different concepts and ideas. Join The JavaScript Track.

  4. 2,500+ JavaScript Practice Challenges // Edabit

    Practice JavaScript coding with fun, bite-sized exercises. Earn XP, unlock achievements and level up. It's like Duolingo for learning to code.

  5. 40 JavaScript Projects for Beginners

    March 24, 2021 / #JavaScript. 40 JavaScript Projects for Beginners – Easy Ideas to Get Started Coding JS. Jessica Wilkins. The best way to learn a new programming language is to build projects. I have created a list of 40 beginner friendly project tutorials in Vanilla JavaScript, React, and TypeScript.