Hacker News new | past | comments | ask | show | jobs | submit login

There is also a very common two-liner invocation that turns them into prototypical classes as well. Extremely versatile data structure (pejorative).





Perl would like to have a word... ;-)

But seriously, they do have some interesting quirks which make sense if you think of it (and maybe Lua as a semi-contemporary got its ideas from there), specifically, hashes are pairs of keys (even/odd) in a flat array... and of course objects are just key/values, but with some values being names and functions...

https://perlmaven.com/creating-hash-from-an-array




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: