When to use Vanilla JavaScript vs. jQuery?

后端 未结 13 1919
独厮守ぢ
独厮守ぢ 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:47

    Here's a non-technical answer - many jobs may not allow certain libraries, such as jQuery.

    In fact, In fact, Google doesn't allow jQuery in any of their code (nor React, because it's owned by Facebook), which you might not have known until the interviewer says "Sorry, but you cant use jQuery, it's not on the approved list at XYZ Corporation". Vanilla JavaScript works absolutely everywhere, every time, and will never give you this problem. If you rely on a library yes you get speed and ease, but you lose universality.

    Also, speaking of interviewing, the other downside is that if you say you need to use a library to solve a JavaScript problem during a code quiz, it comes across like you don't actually understand the problem, which looks kinda bad. Whereas if you solve it in raw vanilla JavaScript it demonstrates that you actually understand and can solve every part of whatever problem they throw in front of you.

    0 讨论(0)
提交回复
热议问题