Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't immutablejs do the deep copying itself?

Even better would be a language (could be plain JS) that enforces immutability. How about a new keyword in Typescript?




There's Object.freeze[1] for that. Of course that's checked only at runtime, because js is a dynamic language …

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


Typescript has a readonly directive you can declare for interfaces, and it gives a type error on assignment.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: