Javascript, The Bad Parts #3: no negative array indexing 😾

On the petty side—gets frowny cat, rather than horror cat. After a decade of Python, it’s surprising to me that Javascript doesn’t allow arr[-1] and such. Maybe negative indices returning undefined is widely relied upon, leading to compatibility issues? Not sure why it’s not a thing—arr[arr.length - 1] is just no fun.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *