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 =
fromJS does a deep conversion. That is, it'll recurse through all the keys and convert all elements to Lists, Maps, etc.
fromJS
In your second example, address is a plain object, not an ImmutableJS object, so you cannot use setIn to change its value.
address
setIn