12 lines
443 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Increment a Number with JavaScript
---
## Increment a Number with JavaScript
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
You can easily increment (add one) to a number variable by using the '++' increment operator. For example:
var a = 6;
a++; // Now, 'a' is equal to 7 -- post-fixing
++a; // Now, 'a' is equal to 8 -- pre-fixing