When to use Vanilla JavaScript vs. jQuery?

后端 未结 13 2127
独厮守ぢ
独厮守ぢ 2020-11-22 09:08

I have noticed while monitoring/attempting to answer common jQuery questions, that there are certain practices using javascript, instead of jQuery, that actually enable you

13条回答
  •  醉话见心
    2020-11-22 09:22

    This is my personal view, but as jQuery is JavaScript anyway, I think theoretically it cannot perform better than vanilla JS ever.

    But practically it may perform better than hand-written JS, as one's hand-written code may be not as efficient as jQuery.

    Bottom-line - for smaller stuff I tend to use vanilla JS, for JS intensive projects I like to use jQuery and not reinvent the wheel - it's also more productive.

提交回复
热议问题