- Arithmetic Operators
- Increment/Decrement Operators
- Assignment Operators
- Comparison Operators
Increment & Decrement Operators
Increment (two plus sign)
++ & Decrement (two minus sign)
-- Operators are used to increase or decrease the value of a variable by 1. Depending on whether the operator sign is used before or after the variable, it produces a different result. However, it still increments or decrements by 1.
``` let count = 0; console.log(count); // prints 0 count++; // first assign the current value back to count and then increase it by 1 ++count; // first increase the value by 1 and then assign the new value to count ```
Assignment operator or equal sign
Increment and Decrement Operators also have a shorthand notation that uses the assignment operator. While increment operator
++ and decrement operator
-- is used to increase or decrease the value by 1, sometimes there is a need to increase or decrease the value by a different amount. In this case a variation of increment
+= and decrement
-= is used.
== and strict
=== or strict equality comparison.
== sign compares only the values to be either truthy or falsy while
=== compares both the values and as well the type of both the values to be equal for a more strict comparison.
Kick-Start Your Web Developer Career
We offer a wide variety of programs and courses built on adaptive curriculum and led by leading industry experts.
- Work on projects in a collaborative setting
- Take advantage of our flexible plans and scholarships
- Get access to VIP events and workshops
Recommended Courses for Web Developer
The Web Development bootcamp is an intensive, hands-on learning experience, designed to introduce the skills and concepts required to build modern web applications.
The part-time Web Development course is designed to provide a crash course in web development, with introductions to HTML, CSS, and the Bootstrap framework.