Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
WA
· 2y ago · 0 comments
Not at all. It’s common to have nested data, it can be quite simple, but still nested. Think: config objects, simple state objects. I want my functions to be pure. Instead of modifying the nested object, they should return a modified deep copy.
Comments
[–]
lambda_garden
2y ago
Use the spread syntax to make a shallow copy; it's more performant.