gorillascript
gorillascript copied to clipboard
Mutable arrays and objects
I would expect this to throw an error.
let arr = [1,2,3,4]
arr.push 5
I would also expect this to throw an error or do a clone
let arr = [1,2,3]
let mutable arrrr = arr
It states in the docs that objects are always mutable, but the variables that point to the object are not. Check out the documentation. Me personally, I'd like to be able to specify properties on objects to be immutable, and also have type checking on object properties.