DEV Community

Sho Miyamoto
Sho Miyamoto

Posted on

The ES6 way to make simple immutable Object hiding properties inside

It's basically good to keep objects immutable for FP and also to make some properties private as long as we are going to enjoy benefits of OOP. To make immutable dict encapsulating properties, now we have 2 options: Symbol and WeakMap which were introduced as new features of ES2015.

So, I made experimentally some models, without any thought of performance though. Would be glad to hear your comments!

Top comments (0)