Skip to content

Commit 05089ba

Browse files
authored
"Use searchable names" and correct unit of time
Assuming that waiting 1/1000 of a day was not intended. Second parameter of setTimeout() is in milliseconds.
1 parent 383dd49 commit 05089ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ can help identify unnamed constants.
7979

8080
**Bad:**
8181
```javascript
82-
// What the heck is 86400 for?
82+
// What the heck is 86400000 for?
8383
setTimeout(() => {
8484
this.blastOff()
85-
}, 86400);
85+
}, 86400000);
8686

8787
```
8888

8989
**Good**:
9090
```javascript
9191
// Declare them as capitalized `const` globals.
92-
const SECONDS_IN_A_DAY = 86400;
92+
const MILLISECONDS_IN_A_DAY = 86400000;
9393

9494
setTimeout(() => {
9595
this.blastOff()
96-
}, SECONDS_IN_A_DAY);
96+
}, MILLISECONDS_IN_A_DAY);
9797

9898
```
9999
**[⬆ back to top](#table-of-contents)**

0 commit comments

Comments
 (0)