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.

Talking about money, tech and how to make money from tech. Real estate investor. Full-stack engineer at https://www.hse24.de/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store