-
Notifications
You must be signed in to change notification settings - Fork 53
added js #59
base: gh-pages
Are you sure you want to change the base?
added js #59
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,23 @@ | ||
| function countdown(seconds){ | ||
| // ... | ||
|
|
||
| function countdown(seconds) { | ||
|
|
||
| console.log(seconds) | ||
|
|
||
| seconds-- | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. |
||
|
|
||
| if (seconds == 0) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use '===' to compare with '0'. |
||
| console.log ("Done"); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'console' is not defined. |
||
| return | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, no need for a |
||
| } else { | ||
| setTimeout(function(){ | ||
| countdown(seconds) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing semicolon. |
||
| }, 1000); | ||
| } | ||
| } | ||
|
|
||
| countdown(5); | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,11 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
|
|
||
| <title>Countdown exercise</title> | ||
| <script src="countdown.js"></script> | ||
| </head> | ||
| <body> | ||
| See console. | ||
| <div id = "status">text 1</div> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
'console' is not defined.