Hacker News new | comments | show | ask | jobs | submit login
An adventure in sparse arrays (remysharp.com)
18 points by fagnerbrack 65 days ago | hide | past | web | favorite | 1 comment



Observation: The way JS handles "holes" in sparse arrays is similar to how Lua resolves non-existent table entries to nil. This can be interesting when people don't know the difference between pairs, ipairs and for 1, #tbl iterations, when the table contains a nil value and the table indexing (index or key) may be unknown.




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

Search: