diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 4fed28f..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..0a18ed3 Binary files /dev/null and b/favicon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..e0df346 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + + JavaScript Basics + + + + + + + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..ca32828 --- /dev/null +++ b/index.js @@ -0,0 +1,13 @@ +// CHALLENGE +// Create a function "waitingFn" with single parameter "timeInMs" and inside of the function create "while" loop and this loop should be running during "timeInMs". +// HINT: Date.now() - current time in ms since 1970 +function waitingFn(timeInMs) { + const futureTime = Date.now() + timeInMs; + while (futureTime > Date.now()) { + // waiting... + } +} + +waitingFn(3000); + +console.log("Function call has just ended"); \ No newline at end of file