hemanth / functional-programming-jargon

Jargon from the functional programming world in simple terms!
http://git.io/fp-jargons
MIT License
18.59k stars 1.02k forks source link

Update readme.md #100

Closed thinkininfinity closed 8 years ago

thinkininfinity commented 8 years ago

a). add the link of immutable.js which supports immutable data b). As we know, const is not an absolute constant sometimes, such like:

const a = { a: 1 };

delete a.a;

console.log(a);
// => {}

Immutable data cannot be changed once created, this is what we want and where immutable.js comes in:

const { fromJS } = require('immutable');

const a = fromJS({ a: 1 });
// a => { "a": 1 }

const b = a.delete('a');
// a => { "a": 1 }
// b => {}

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.

thinkininfinity commented 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.