Skip to content
loading...

The ES6 way to make simple immutable Object hiding properties inside

github logo ・1 min read  

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!

twitter logo DISCUSS
Classic DEV Post from Sep 5 '19

What do you wish to know about JavaScript when you were in university?

Sho Miyamoto profile image