3 ms·
JavaScript general utility: lodash and jQuery. For dates and currency: Moment.js and the numeral.js but I don't consider then "general utility" so much as "not
by mikece 8y ago
JavaScript general utility: lodash and jQuery. For dates and currency: Moment.js and the numeral.js but I don't consider then "general utility" so much as "not infrequently needed."
- onion2k 8y agoYou probably don't need jQuery unless you're supporting old browsers. Ajax has been 'replaced' by fetch, DOM updates are straightforward with querySelector, class manipulation is easy using classList, and animation can be done in CSS. jQuery is still useful for some UI elements like date pickers or orderable lists, but there are significant accessibility issues around most plugins. If you're using something to transpile (eg Babel) your code then you don't really need anything like lodash. es6 has most of the array and object functions you typically want, like map, reduce, filter, Array.from(), etc. Date formating with Moment.js is really nice, but it's big (30kb) so if you're only using a small part of the functionality it might be better to use Luxon (https://moment.github.io/luxon/index.html https://moment.github.io/luxon/index.html) as that should be tree-shakable using Webpack.
- codedokode 8y agoDOM methods are less convenient compared to jQuery. Also I think it makes sense to support browsers at least 5-7 years back so it is too early to deprecate jQuery. But I don't like that it is huge and not modular. And that it is not strict in argument checking and accepts anything without throwing any errors.
- actsasbuffoon 8y agoRamda is a nice alternative to lodash and underscore. If you like the Haskell style of creating tiny helper functions by partially applying functions, Ramda is great.
- Retra 8y agoIs it faster?