I can't tell you how much time I spent chasing a bug when it was a date that was passed by reference.
Rather than trying to keep track, I just return copies of arrays and objects and it's way easier.
Even a simple
``` function yeppers(input) => ({...input, x: 7}) ```
(An overly simple example)
has made things smoother.
I can't tell you how much time I spent chasing a bug when it was a date that was passed by reference.
Rather than trying to keep track, I just return copies of arrays and objects and it's way easier.
Even a simple
``` function yeppers(input) => ({...input, x: 7}) ```
(An overly simple example)
has made things smoother.