Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 01/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function showTime() {
const time = new Date().toLocaleDateString();
console.log(time);
}

showTime();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

5 changes: 5 additions & 0 deletions 02/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function sayHello(name) {
console.log(`Cześć ${name}!`);
}

sayHello("devmentor.pl");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

16 changes: 16 additions & 0 deletions 03/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const sumNum = function (num) {
let resultStr = "";
let sum = 0;
for (let i = 1; i <= num; i++) {
sum += i;
resultStr += i;
if (i == num) {
break;
}
resultStr += "+";
}
resultStr += "=" + sum;
return resultStr;
};

console.log(sumNum(4));
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

14 changes: 14 additions & 0 deletions 04/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let idInterval;
let counter = 0;

runTimer = function () {
counter++;
if (counter > 5) {
clearInterval(idInterval);
console.log("Timer has been ended.");
return;
}
console.log(`${counter}: ${Date()}`);
};

idInterval = setInterval(runTimer, 5000);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍