diff --git a/src/trivial_example_of_hashmap.ts b/src/trivial_example_of_hashmap.ts new file mode 100644 index 0000000..8f1db31 --- /dev/null +++ b/src/trivial_example_of_hashmap.ts @@ -0,0 +1,18 @@ +let websites = [ + "https://google.com", + "https://lapresse.ca", + "https://theguardian.com" +]; + +function computeTimeToLoad(url: string): number{ + return 98; +} + +function computeAllLoadTime(websites: string[]): Map{ + let ret = new Map(); + for(let website of websites){ + ret.set(website, computeTimeToLoad(website)); + } + return ret; +} +