freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../basic-javascript/decrement-a-number-with-jav.../index.md

12 lines
331 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Decrement a Number with JavaScript
---
## Decrement a Number with JavaScript
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
Decrement a number using the '--' operator:
var a = 5;
a--; // Now, 'a' is 4
--a; // Now, 'a' is 3