DEV Community

Discussion on: Things I wish I can use in React/Javascript from Elixir

tehaisperlis profile image
Hazmi Irfan Author

For the first and second points, there are some proposals in stage in the ecma365, for adding patter matching with switch expressions, pipeline operator and currying operator.
Cool. Looking forward to it!

For the Atom you can use Symbols.
Unfortunately you still have to initialize the symbol which for me is still the same as creating a constant.

Immutability can be achieved using constants and Object freeze.
You can still change the nested value of const and Object freeze unless you do a deep freeze which I believe is a bit costly.