From 7ab6413484981391d23501db2b5ab7f73ec335b2 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Fri, 22 Sep 2023 14:27:46 -0400 Subject: [PATCH] blah --- src/trivial_example_of_hashmap.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/trivial_example_of_hashmap.ts 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; +} +