3 ms·
It's very unpractical and error prone. You call a function that requires a date (moment) object, and after the call you want to do something else with that dat
by riquito 6y ago
It's very unpractical and error prone.
You call a function that requires a date (moment) object, and after the call you want to do something else with that date. Was it modified? Who knows. You will have to clone it before calling the aforementioned function. Otherwise, bugs.
You write a function that expects a date (moment) object. You want a different date (say "the day after"). If you call a method on the object, will the parent be smart enough not to touch anymore the date? You can't know that, so you will have to (remember to) start by cloning the date. Otherwise, bugs