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

👍

4 changes: 4 additions & 0 deletions 02/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function sayHello(name) {
console.log(`hej ${name}`);
}
sayHello('Sebastian')
13 changes: 13 additions & 0 deletions 03/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const getNumber = function (num) {
let result = 0

for (let i = 0; i <= num; i++) {
result = result + i

}
return result
}


const sum = getNumber(4)
console.log(sum);
17 changes: 17 additions & 0 deletions 04/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const timeInterval = 5;
let counter = 0;
const stopInterval = 5;

function runTime() {
const time = new Date().toLocaleTimeString();
console.log(time);

for (let i = 1; i <= timeInterval; i++) {
console.log(i);

}
}

setInterval(function () {
runTime();
}, 2000);
2 changes: 1 addition & 1 deletion 04/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<title>JavaScript: Podstawy, funkcje #04 - devmentor.pl</title>
</head>
<body>
<script src="./app.js"></script>
<script src="../04/app.js"></script>
</body>
</html>