Closed ShalokShalom closed 3 years ago
hello, i'm not sure what is wrong with const
with prelude? seems the collections are immutable it should work?
> const vec1 = Vector.of(1,2,3)
undefined
> vec1 = Vector.of(2,3)
Uncaught TypeError: Assignment to constant variable.
> vec1.toArray()
[ 1, 2, 3 ]
> vec1.append(4).toArray()
[ 1, 2, 3, 4 ]
> vec1.toArray()
[ 1, 2, 3 ]
Hi there :)
Is there any chance to get a real, serious constant binding, that does what it says?
So deep freeze combined with casual const.
Thanks a lot
Edit: Seems like readonly does the job.