-
Notifications
You must be signed in to change notification settings - Fork 172
tasks done #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
tasks done #154
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| function showTime() { | ||
| date = (new Date()).toLocaleTimeString() | ||
| console.log(date) | ||
| }; | ||
|
|
||
| showTime(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| function sayHello(name) { | ||
| alert(`Cześć, ${name}!`) | ||
| }; | ||
|
|
||
|
|
||
| sayHello("devmentor.pl"); | ||
|
Owner
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. 👍 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| sumNumbers = function (number) { | ||
|
Owner
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. Warto dodać |
||
| let sum = 0; | ||
|
|
||
| for (let i = 1; i <= number; i++) { | ||
| sum += i; | ||
| } | ||
|
|
||
| return sum | ||
| }; | ||
|
|
||
| console.log(sumNumbers(4)); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| let counter = 0; | ||
|
|
||
| intervalId = setInterval(function () { | ||
| date = (new Date()).toLocaleTimeString(); | ||
|
Owner
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. Lepiej nie tworzyć zmiennych globalnych, dlatego warto dodać |
||
| console.log(date); | ||
| counter += 1; | ||
| if (counter >= 5) { | ||
| clearInterval(intervalId); | ||
| }; | ||
| }, 5000); | ||
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.
👍