Hacker News new | ask | show | jobs
by bpicolo 3596 days ago
Dang, just like PHP (no built in set)
1 comments

And yet there is a generic in array function.
...which is O(n). Unless the set is trivially small, better to coerce your data to key types and use array_key_exists().
I never said it was good, but it exists. Most of my PHP code utilizes kv arrays everywhere possible.