Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
narrowtux
8y ago
0 comments
Share
You could just store your modified state to new variables though
0 comments
default
newest
oldest
yorwba
8y ago
Or you could just make copies of state you want to keep before mutating it. Both mutable imperative code and immutable functional code can emulate each other, so which one to choose largely depends on your preferences.
junke
8y ago
In a live-coding session, how does the existing, running code knows that it should look at the new variables instead of the old ones?
valw
8y ago
Have a look at the video. Having immutable values doesn't mean you have immutable variables / names.
junke
8y ago
I know, the parent post was saying "you could just store your modified state to
new
variables", not replace what
existing
variables are bound to.
j
/
k
navigate · click thread line to collapse