Comment on Structs and ImmutableStructsComments−ape412yOne way to make an immutable constant: function rentAmountDollars() { return 600; }−i_s12yrentAmountDollars = function() { return 601; }−thekaleb12yThis will work with pass-by-value primitives, but not pass-by-reference objects unless the getter re-creates the object for every get action.
Comments
One way to make an immutable constant:
rentAmountDollars = function() { return 601; }
This will work with pass-by-value primitives, but not pass-by-reference objects unless the getter re-creates the object for every get action.