What is the difference between ImmutableJS Map() and fromJS()?
var a = {address: {postcode: 5085}} var b = Immutable.fromJS(a) var c = b.setIn(['address', 'suburb'], 'broadview').toJS(); // no error console.log(c); var d = Immutable.Map(a); var e = d.setIn(['address', 'suburb'], 'broadview').toJS(); // error invalid keyPath(…) Could someone explain the difference. Thanks, Samu Joseph In this example, var a = {address: {postcode: 5085}} var d = Immutable.Map(a); Here, d.get('address') is immutable . It's value cannot change to any other objects. We can only create a new Object from the existing object using the Immutable.Map.set() function of ImmutableJS.