4 ms·
Basically, unexpected behavior. One of the "footguns" is that it's easy to write to a Moment object when you mean to be reading from it. And by the way, you can
by turdnagel 6y ago
Basically, unexpected behavior. One of the "footguns" is that it's easy to write to a Moment object when you mean to be reading from it. And by the way, you can mutate objects declared with `const` in JS - you just can't reassign them.
- holtalanm 6y agoI don't view the mutability of moment as a complete show stopper, though. If you limit the surface area of the mutability by hiding the underlying moment object within an abstraction, then you can at the very least keep the chances of misusing moment to a minimum.
- turdnagel 6y agoI also think it's not a showstopper for Node.js apps. For bundling in a front-end app it's waaaay too big.
- hajile 6y agoThe moment locales webpack plugin goes a very long way toward dealing with the size downside of the library. That said, we wouldn't be in this position if more companies used a shared CDN for libraries instead of always bundling them.
- jbboehr 6y ago> shared CDN That helps with transfer but clients still have to parse and execute the javascript which can be significant, especially on mobile devices.