Hacker News new | ask | show | jobs
by frankosaurus 4341 days ago
In multi-threaded environments, immutable objects are thread-safe. When multiple threads are sharing data, you would normally have to worry about synchronization. However, immutable data structures guarantee that the shared data will not change, so synchronization issues simply go away.

That said, I'm not sure how this applies to JS, which is single-threaded.

1 comments

Even though it's single-threaded (not with web threads maybe?), it can still be asynchronous, which is where the issues really lie.