Email or username:

Password:

Forgot your password?
Top-level
hazel

@lily
const obj = {}
obj.whatever = “i can do this”
obj = { butICannot: “do this” }

const arr = []
arr.push(“this is fine!”)
arr = [“but this will throw.”]

it is Just the = on the variable itself, none of its fields or anything is constant

1 comment
hazel

@lily what i find more weird honestly is how strict strings and numbers are. cause- why doesnt this work? strings are arrays of characters why are they more constant than normal arrays?

a constant string str with the text “jello” is created. str[0] is used to edit the first character of the string to swap it for an “h”, but while this does not throw, it does not work either
Go Up