" Write a function to add two numbers and return the result. Create a function to check if a number is even or odd. Write a fun"> " Write a function to add two numbers and return the result. Create a function to check if a number is even or odd. Write a fun">

📲 Download Utility Tools Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

JavaScript Functions – Practice Questions

🔹 Basic Level (1–7)

  1. Create a function that prints "Hello World".
  2. Create a function that takes a name as input and prints:
    👉 "Hello, <name>"
  3. Write a function to add two numbers and return the result.
  4. Create a function to check if a number is even or odd.
  5. Write a function that returns the square of a number.
  6. Create a function that converts Celsius to Fahrenheit.
  7. Write a function that finds the maximum of two numbers.

🔹 Intermediate Level (8–14)

  1. Create a function to calculate the area of a circle.
  2. Write a function that counts the number of vowels in a string.
  3. Create a function that reverses a string.
  4. Write a function that checks if a number is prime.
  5. Create a function that takes an array and returns the sum of all elements.
  6. Write a function that finds the largest number in an array.
  7. Create a function that calculates factorial of a number.

🔹 Advanced Level (15–20)

  1. Convert a normal function into an arrow function.
  2. Write a function with default parameters (e.g., greet user with default name).
  3. Create a function expression that multiplies two numbers.
  4. Write a callback function example:
    👉 One function should accept another function as argument.
  5. Create a function that filters even numbers from an array.
  6. Build a mini calculator using functions:
    👉 add, subtract, multiply, divide

🚀 for students

👉 Combine everything:

  • Take user input
  • Use functions
  • Display result in HTML

Mini project using functions (calculator app)



AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes