Friday, June 26, 2015

javascript immutable state or mutable state

Using var to declare variable inside a function, that variable can only be accessed inside the function. It is an immutable state. It is kind of private property in java.
If 'this.' is used in the front of the variable, the variable can be accessed from outside and it is mutable state. It is kind of public property in java.

No comments:

Post a Comment