MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Arithmetic Operators0%
Study Materials
JavaScript for BeginnersProgress 0%
1.1What is JavaScript?1.2How JavaScript Works in Browser1.3Setting up Environment: VSCode, Live Server
3.1Arithmetic Operators3.2Comparison Operators3.3Logical Operators3.4Assignment & Ternary Operator
HomeTutorialsJavaScript for BeginnersArithmetic Operators
Comparison Operators

Arithmetic Operators

Beginner12 min read•Updated: 2026-09-15•By Er. Sumit Kumar (MSK Institute)
Study Materials

Arithmetic operators allow programs to perform mathematical calculations on numerical operands. JavaScript provides all standard mathematical operations along with exponentiation, modulo division, and unary increment/decrement operators.


1. Core Arithmetic Operators

OperatorNameExampleResultDescription
+Addition10 + 515Adds two numbers (also concatenates strings!)
-Subtraction20 - 812Subtracts right operand from left
*``**Multiplication6 * 742Multiplies two numbers
/Division20 / 45Divides left operand by right operand
%Modulus (Remainder)14 % 42Returns integer remainder of division
``**Exponentiation (ES6)2 ** 38Raises base to power of exponent ($2^3$)

2. Modulus % vs. Math Power **

The Power of Modulus %:

The remainder operator is frequently used to determine even/odd status or cycle through array indices:

1// Check if a number is even
2const isEven = (num) => num % 2 === 0;
3 
4console.log(isEven(8)); // true
5console.log(isEven(7)); // false
6 
7// Cycling through 7 days of the week:
8let dayIndex = 10 % 7; // 3 (Wednesday)

Exponentiation **:

1console.log(3 ** 2); // 9 (3 squared)
2console.log(4 ** 0.5); // 2 (Square root of 4!)

3. Increment (++) and Decrement (--)

JavaScript supports both prefix and postfix increment and decrement:

1let count = 5;
2 
3// Postfix (increments AFTER current expression evaluates):
4let a = count++; // a is 5, count is now 6
5 
6// Prefix (increments BEFORE current expression evaluates):
7let b = ++count; // count becomes 7, b is 7
Pro Tip
[!TIP] In modern clean code, avoid burying ++ inside complex expressions. Write it on its own line: ```javascript count++; ```

4. The Addition Trap: String Concatenation (+)

The plus operator (+) is overloaded in JavaScript:

  • If both operands are numbers, it performs mathematical addition.
  • If either operand is a string, it performs string concatenation!
1console.log(10 + 20); // 30 (Number addition)
2console.log("10" + 20); // "1020" (String concatenation!)
3console.log(10 + 20 + "5");// "305" (Left-to-right: 10+20=30, then 30 + "5" = "305")
4console.log("5" + 10 + 20);// "51020" ("5"+10="510", then "510"+20="51020")

Type Conversion Tip: Unary Plus (+)

Prefixing any string containing numbers with + converts it directly into a number:

1let strAge = "25";
2let numAge = +strAge; // Exactly 25 (number)
3console.log(typeof numAge); // "number"

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
What is the result of the expression 17 % 5 in JavaScript?
Question 2
What does the expression 2 ** 4 evaluate to?
Question 3
What is the result of "10" + 5 in JavaScript?
Question 4
If let x = 3; let y = x++;, what are the values of x and y respectively?
Question 5
How can you quickly convert the numeric string "42" into the primitive number 42 using an arithmetic operator?
Next Lesson

Comparison Operators

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Comments and Best PracticesComparison Operators

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

Mentor-Led Practical Training

Master JavaScript for Beginners with Hands-On Projects

Practice in live mentor-led sessions with real projects, mock tests, and verifiable certification at MSK Institute.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext