Skip to content

Instantly share code, notes, and snippets.

@alwell-kevin
Created October 23, 2023 15:40
Show Gist options
  • Save alwell-kevin/50a2beb4c57f4403038f2567aabbf9cd to your computer and use it in GitHub Desktop.
Save alwell-kevin/50a2beb4c57f4403038f2567aabbf9cd to your computer and use it in GitHub Desktop.
JavaScript

Beginner JavaScript Exercises:

  1. Create a variable and store your name in it.
  2. Write a function that adds two numbers and returns the result.
  3. Display an alert with a greeting message.
  4. Use the console.log to print "Hello, World!" to the browser console.
  5. Create an array of fruits and access a specific fruit by its index.
  6. Write a function that takes a number as an argument and returns whether it's even or odd.
  7. Use a for loop to print numbers from 1 to 10 in the console.
  8. Create an object representing a person with properties like name and age.
  9. Create a button that changes the text on a webpage when clicked.
  10. Implement a simple calculator that can perform basic operations (addition, subtraction, multiplication).
  11. Write a function to find the length of a string.
  12. Create an array of colors and display them as a list on a webpage.
  13. Use if-else statements to check if a number is positive, negative, or zero.
  14. Build a basic HTML form with text input and a submit button.
  15. Develop a simple rock-paper-scissors game that can be played in the browser console.

Intermediate JavaScript Exercises:

  1. Create a function to reverse a string without using built-in methods.
  2. Build a to-do list application that allows adding, deleting, and marking tasks as completed.
  3. Develop a basic quiz application with multiple-choice questions and a scoring system.
  4. Implement a countdown timer that triggers an action when it reaches zero.
  5. Build a simple image carousel that allows users to navigate through a set of images.
  6. Create a program that generates a random password with customizable length and complexity.
  7. Develop a weather app that fetches and displays current weather data using an API.
  8. Write a function to search and filter an array of objects based on specific criteria.
  9. Implement a responsive navigation menu that changes appearance on smaller screens.
  10. Create a form validation script that checks user input and provides feedback.
  11. Build a basic chat application with real-time messaging using WebSockets.
  12. Develop a small e-commerce shopping cart with product listings, a shopping cart, and checkout functionality.
  13. Implement user authentication and secure password storage for a web application.
  14. Create a memory card game with a grid of cards that the player can match.
  15. Build a simple calculator that can handle more complex operations like square root and exponentiation.

Junior JavaScript Developer Interview Questions:

  1. What are the basic data types in JavaScript?
  2. Explain the difference between null and undefined in JavaScript.
  3. How do you handle asynchronous operations in JavaScript, and what are Promises?
  4. Can you describe the concept of scope and how it works in JavaScript?
  5. What is a closure in JavaScript, and provide an example of its use.
  6. How would you iterate through the properties of an object?
  7. Explain the difference between let, const, and var in variable declaration.
  8. How can you avoid callback hell (callback pyramid) when working with asynchronous code?
  9. What is the purpose of the this keyword in JavaScript, and how does it behave in different contexts?
  10. What are arrow functions, and how do they differ from regular functions?

These questions can help you demonstrate your understanding of JavaScript fundamentals and development practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment