From 05089ba5de6a50190eaadd14276225d06863a8a0 Mon Sep 17 00:00:00 2001 From: Jako Danar Date: Thu, 12 Jan 2017 02:36:50 +0100 Subject: [PATCH] "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. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4f8ca461..0ee8b3cc 100644 --- a/README.md +++ b/README.md @@ -79,21 +79,21 @@ can help identify unnamed constants. **Bad:** ```javascript -// What the heck is 86400 for? +// What the heck is 86400000 for? setTimeout(() => { this.blastOff() -}, 86400); +}, 86400000); ``` **Good**: ```javascript // Declare them as capitalized `const` globals. -const SECONDS_IN_A_DAY = 86400; +const MILLISECONDS_IN_A_DAY = 86400000; setTimeout(() => { this.blastOff() -}, SECONDS_IN_A_DAY); +}, MILLISECONDS_IN_A_DAY); ``` **[⬆ back to top](#table-of-contents)**