From 0a08a86d1ba1952020d0f8dfb3920bce9f29684b Mon Sep 17 00:00:00 2001 From: Dana Tabatabaie Irani Date: Fri, 27 Dec 2019 14:19:13 +0100 Subject: [PATCH 1/3] Corrected some code errors. --- WF_I_07_Promises_and_Workers.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WF_I_07_Promises_and_Workers.md b/WF_I_07_Promises_and_Workers.md index 5672c8c..04f6dec 100644 --- a/WF_I_07_Promises_and_Workers.md +++ b/WF_I_07_Promises_and_Workers.md @@ -138,7 +138,7 @@ const test = (input) => { diffTime = performance.now() - startTime; console.log (`Start Execution: ${diffTime} ms`); -test ( 0 ); +test(0); diffTime = performance.now() - startTime; console.log (`End script: ${diffTime} ms`); @@ -221,7 +221,7 @@ const test = (input) => { diffTime = performance.now() - startTime; console.log (`Start Execution: ${diffTime} ms`); -test ( 0 ).then(input =>{ +test(0).then(input =>{ diffTime = performance.now() - startTime; console.log (`Returning input ${input}: ${diffTime} ms`); }); @@ -261,7 +261,7 @@ As promised, I would like to add a few words on Web workers. With Moore's law dy Let us consider the following case: ```js -for (let i = 0; i++; i< 100000>){ +for (let i = 0; i< 100000; i++){ // do stuff } ``` @@ -269,9 +269,9 @@ for (let i = 0; i++; i< 100000>){ The goal of parallelisation would be to divide the above workload into smaller chunks that run on parallel processors. Remember that approaching this with the `setTimeout (..., 0)` trick would still have the code run with the same thread, albeit allowing the browser to perform some rendering in between the chunks: ```js -for (let i = 0; i++; i< 100>){ +for (let i = 0; i< 100; i++){ setTimeout (() => { - for (let i = 0; i++; i< 1000>){ + for (let i = 0; i< 1000; i++){ // do stuff } }, 0); @@ -325,7 +325,7 @@ All we are left to do is to create multiple web workers to achieve parallelism. isolatedTask = (index, input) => { let resultChunk = []; - for (let i = 0; i++; i< 1000>){ + for (let i = 0; i< 1000; i++){ resultChunk [i] = doHeavyStuff(); } From 7b23ccf2ab85b3385a00fadc8274ef98dd3c1d63 Mon Sep 17 00:00:00 2001 From: Dana Tabatabaie Irani Date: Fri, 27 Dec 2019 20:17:03 +0100 Subject: [PATCH 2/3] Changed double i variable inside loop. --- WF_I_07_Promises_and_Workers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WF_I_07_Promises_and_Workers.md b/WF_I_07_Promises_and_Workers.md index 04f6dec..ed68000 100644 --- a/WF_I_07_Promises_and_Workers.md +++ b/WF_I_07_Promises_and_Workers.md @@ -271,7 +271,7 @@ The goal of parallelisation would be to divide the above workload into smaller c ```js for (let i = 0; i< 100; i++){ setTimeout (() => { - for (let i = 0; i< 1000; i++){ + for (let j = 0; j< 1000; j++){ // do stuff } }, 0); From db2c88a6b56a117aca9fda21ab951bd925d36881 Mon Sep 17 00:00:00 2001 From: Dana Tabatabaie Irani Date: Fri, 27 Dec 2019 20:19:45 +0100 Subject: [PATCH 3/3] Added missing html hightlights. --- WF_I_06_Angular.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WF_I_06_Angular.md b/WF_I_06_Angular.md index 6243679..a2787bc 100644 --- a/WF_I_06_Angular.md +++ b/WF_I_06_Angular.md @@ -133,9 +133,11 @@ In the above example `item.type` (template expression) is not allowed to have si The combination of an event binding and a property binding leads to a two-way binding: +```html
{{ displayTypeOfComponent }}
+``` ### Template Reference Variables