Increment (++) Operator in JavaScript



The increment operator increases an integer value by one. Here’s an example where the value of a is incremented twice using the increment operator twice

Example

Live Demo

<html>
   <body>
      <script>
         var a = 33;
         a = ++a;
         document.write("++a = ");
         result = ++a;
         document.write(result);
      </script>
   </body>
</html>
Updated on: 2020-06-15T05:39:26+05:30

696 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements