Closed AjaxSolutions closed 10 months ago
Minor improvement suggestion.
Array.from vs Spread
const isEqualSet = (a: Set<unknown>, b: Set<unknown>) => a === b || (a.size === b.size && Array.from(a).every((v) => b.has(v)));
vs.
const isEqualSet = (a, b) => a === b || (a.size === b.size && [...a].every(v => b.has(v)));
Array.from seems faster in my case.
Hmmm... this must be browser dependent. I'm on an old iMac using the MS Edge browser., and spread is faster in my case.
OK, I'll close this issue.
Minor improvement suggestion.
Array.from vs Spread
vs.