Closed thinkininfinity closed 8 years ago
Yes, simple is important.
The constant
and immutable data
is the same concept, but the keyword const
cannot create a safe context:
const a = { ... };
func(a);
// after func(), a is not a safe variable any more
So suggest add more annotation about the differences between constant in functional programming and constant in javascript.
a). add the link of immutable.js which supports immutable data b). As we know,
const
is not an absolute constant sometimes, such like:Immutable data cannot be changed once created, this is what we want and where immutable.js comes in:
c). Are all code snippets should be rewrote by immutable.js ? Not sure about all, but it is more accurate for the code snippet of Constant.