Conversation
devmentor-pl
left a comment
There was a problem hiding this comment.
Sebastianie,
Zostawiłem kilka podpowiedzi :)
| console.log(time); | ||
| } | ||
|
|
||
| showTime(); |
02/app.js
Outdated
| @@ -0,0 +1,5 @@ | |||
| function sayHello(name) { | |||
| name = "devmentor.pl!"; | |||
There was a problem hiding this comment.
Tutaj jest błąd sam parametr przyjmuje jakaś wartość - nie należy go nadpisywać. Ta linia jest niepotrzebna.
02/app.js
Outdated
| name = "devmentor.pl!"; | ||
| console.log(`czesc ${name}`); | ||
| } | ||
| sayHello(name); |
There was a problem hiding this comment.
Dopiero tutaj definiujemy wartość dla parametru - powinno być sayHello("devmentor.pl") w takiej sytuacji niejawnie mamy przypisanie tj. name = "devmentor.pl"
03/app.js
Outdated
| @@ -0,0 +1,3 @@ | |||
| function () { | |||
There was a problem hiding this comment.
Czyli zaczynamy od czegoś takiego const sum = function() { ... } - reszta jak do tej pory.
04/index.html
Outdated
| <script src="../04/scrypt.js"></script> | ||
| <script src="./ap.js"></script> |
There was a problem hiding this comment.
Dlaczego tutaj coś zmieniałeś? Powinno być ./app.js jak w pozostałych. Może był problem ze sposobem uruchomienia live servera?
04/app.js
Outdated
| idInterval = setInterval(showCounter, 2000); | ||
| stopTime = setInterval(showCounter, 2000); |
There was a problem hiding this comment.
NIe wiem dlaczego tutaj uruchamiasz 2 razy tą samą funkcję. Zostawmy pierwsze uruchomienie i podmieńmy nazwę funkcji tj.
idInterval = setInterval(runTime, 2000);
04/app.js
Outdated
| const time = new Date().toLocaleTimeString(); | ||
| console.log(time); | ||
|
|
||
| const showTimeCounter = function () { |
04/app.js
Outdated
| const showTimeCounter = function () { | ||
| counterTwo++; | ||
| if (counterTwo > 5) { | ||
| clearInterval(stopTime); |
There was a problem hiding this comment.
Trzeba jeszcze tylko podmienić odpowiednią nazwę zmiennej: clearInterval(idInterval);

No description provided.