Hacker News new | past | comments | ask | show | jobs | submit login

One way to make an immutable constant:

    function rentAmountDollars() {
      return 600;
    }



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: