Back to Course

Introduction to JavaScript

0% Complete
0/0 Steps
  1. JavaScript: Basics
    9Topics
    |
    10 Quizzes
  2. JavaScript: Variables
    9Topics
    |
    10 Quizzes
  3. JavaScript: Conditional Statements
    10Topics
    |
    11 Quizzes
  4. JavaScript: Functions
    10Topics
    |
    11 Quizzes
  5. JavaScript: Scope
    6Topics
    |
    7 Quizzes
  6. JavaScript: Arrays
    11Topics
    |
    12 Quizzes
  7. JavaScript: Loops
    8Topics
    |
    9 Quizzes
  8. JavaScript: High Order Functions
    3Topics
    |
    4 Quizzes
  9. JavaScript: Iterators
    6Topics
    |
    6 Quizzes
Lesson 2, Topic 6
In Progress

JavaScript: Increment and Decrement Operator

Yasin Cakal 29 Oct 2021
Lesson Progress
0% Complete

The increment operator ++ and decrement operator -- are two other mathematical assignment operators.

The increment operator increases the variable’s value by one. The decrement operator decreases the variable’s value by one.

For example: Increment Operator

let x = 99;
x++;
console.log(x); // Output: 100

For example: Decrement Operator

let x = 99;
x--;
console.log(x); // Output: 98

The variable’s value is changed and assigned as the variable’s new value, just as the previous mathematical assignment operators +=, -=, *= and /=.

Responses

Leave a Reply

%d bloggers like this: