3 ms·
This site gets posted a lot. However if you looks the comparison code for vanilla JavaScript vs jquery, it looks like the jquery syntax is much easier to compre
by ab_testing 4y ago
This site gets posted a lot. However if you looks the comparison code for vanilla JavaScript vs jquery, it looks like the jquery syntax is much easier to comprehend.
- somecommit 4y agoClearly posting this in 2022 is really funny, it is almost 10 year old I guess? Technically it's still interesting for improving one code style but does jQuery still heavy in use nowadays? I mean people use it, but I suppose more by choice than by default, they have to really WANT to use it.
- brettermeier 4y agojQuery is still nice to use, I do it sometimes these days.
- philmcc 4y agoConfession: I use it constantly. The thought of having to look up how to do absolutely everything makes me wince. I am -genuinely- open to suggestions on how to get over that I just can’t currently justify making everything harder “for a short while” when that short while feels like it could be weeks or months to catch up to fluency.
- eurasiantiger 4y agoInstead of elems = $(selector, context), use elems = […context.querySelectorAll(selector)] Instead of $.get(), use await fetch() Instead of .on(eventtype, handler), use elem.addEventListener(eventtype, handler) Instead of .animate(), use CSS animations
- schwartzworld 4y agoIf the syntax for what you want to do is slightly more verbose, JavaScript has a concept of functions which allow you to reuse code quite easily: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guid...
- aserafini 4y agoYou don’t even need to write your own functions: the JavaScript ecosystem has the concept of packaging functions and publishing them as useful libraries! https://www.npmjs.com/package/jquery https://www.npmjs.com/package/jquery