Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
ape4
on June 18, 2014
|
parent
|
context
|
favorite
| on:
Structs and ImmutableStructs
One way to make an immutable constant:
function rentAmountDollars() { return 600; }
i_s
on June 18, 2014
|
next
[–]
rentAmountDollars = function() { return 601; }
thekaleb
on June 18, 2014
|
prev
[–]
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: