Rich
clearfix.dev
Rich
@clearfix.dev
#London based software developer. Ecom on Cloudflare Workers, prev CTO @ ParadeWorld #JavaScript #TypeScript #React 🔥 #Remix 🔥 #Node #GraphQL and a bit of #F1

https://github.com/richardscarrott
I don't think your reduce example is O(n^n) but rather O(n^2)? Still not great, but not exponential. You could use reduce in linear time by mutating the accumulator, but your use of entries is certainly nicer. Entries seem to have made their way into so many JS APIs now, super useful.
April 29, 2025 at 4:03 PM
Totally but I never quite trust the answer. Bit like Wikipedia.
December 7, 2024 at 9:44 PM