diff --git a/Chapter 13/concurrency_chapter/eventloop-async.js b/Chapter 13/concurrency_chapter/eventloop-async.js new file mode 100644 index 0000000..19f97fe --- /dev/null +++ b/Chapter 13/concurrency_chapter/eventloop-async.js @@ -0,0 +1,7 @@ +console.log("Hi there"); +setTimeout(() => console.log("Sorry I'm late"), 1000); +console.log(add(4,5)); + +function add(x, y) { + return x + y; +} \ No newline at end of file diff --git a/Chapter 13/concurrency_chapter/eventloop-sync.js b/Chapter 13/concurrency_chapter/eventloop-sync.js new file mode 100644 index 0000000..f904d71 --- /dev/null +++ b/Chapter 13/concurrency_chapter/eventloop-sync.js @@ -0,0 +1,6 @@ +console.log("Hi there"); +add(4,5); + +function add(x, y) { + return x + y; +} \ No newline at end of file