Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
7 changes: 7 additions & 0 deletions 01/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function showTime(){

const time = (new Date()).toLocaleTimeString();
console.log(time);
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.

Uwaga na odstępy od lewej krawędzi ;)

PS. Powinno być na równi z const

}

showTime();
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.

👍

11 changes: 11 additions & 0 deletions 03/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const sumNumbers = function(lastNumberToSum) {
let sum = 0;

for (let i = 1; i <= lastNumberToSum; i++){
sum += i;
}
return sum;
}


console.log(sumNumbers(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.

👍

18 changes: 18 additions & 0 deletions 04/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function runTimer(){

let counter = 0;

const myInterval = setInterval(function(){
const time = (new Date()).toLocaleTimeString();
console.log(time);
counter++;

if(counter > 4) {
clearInterval(myInterval)
}
},5000)
}

runTimer();
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.

👍