Email or username:

Password:

Forgot your password?
Top-level
rini ☔

@lily @h const in js is a lie, it only means you can't reassign to the variable
an array is just an object, so you can mutate any property in it (or even add more, which is honestly more cursed)

4 comments
rini ☔

@lily @h node even displays that properly oml

Hazel :pleadingcat:

@rini @lily yep, its just showing all key value pairs of the array and hiding the numbered keys. and those keys are actually strings btw not numbers, kinda

rini ☔

@h @lily yeah the indices are all treated as strings (but optimised internally). by the spec arrays are "exotic objects", which means their impl can do weird things (length being set automatically when indices are added)

also fun fact most array methods dont actually require an array, so you can do [].join.call({ 0: "a", 1: "b", length : 2 }, ", ")

IAG

@rini @lily @h Java's final qualifier is the same

Go Up