Angad Singh
1 min readApr 3, 2020

--

Hello Jeffrey C Dege! thanks for the response,will reply here as well to make it easier visible for other users:

Please note that parsedNumbers is a JavaScript object not an array. If it was an array you would be correct — the worst case scenario would be iterating through the array to find the value and thus the time complexity would be O(n²).

However, similar to a traditional HashTable, the retrieval of a key’s value from a JS object is in O(1) as explained here.

--

--

Angad Singh
Angad Singh

Written by Angad Singh

Talking about money, tech and how to make money from tech. https://captainkong.io

No responses yet