2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Decrement a Number with JavaScript
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Decrement a Number with JavaScript
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Hints
|
|
|
|
|
|
|
|
### Hint 1
|
2018-10-12 15:37:13 -04:00
|
|
|
Decrement a number using the '--' operator:
|
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```javascript
|
|
|
|
var a = 5;
|
|
|
|
a--; // Now, 'a' is 4
|
|
|
|
--a; // Now, 'a' is 3
|
|
|
|
```
|