哪个具有更好的性能jQuery类选择器或document.querySelectorAll?

I am trying to aim not to use jQuery and just rely on JavaScript/ES6 codes. I think selecting elements can be achievable by using JavaScript's document.queryselectorAll and assign it to a variable. I think it also offers some optimization because we are not using a library.

Do you have any idea if there is a performance difference between jquery class selector vs document.queryselectorAll?

For example: $(".list-wrap .list-item") vs var elementSelector = document.querySelectorAll(".list-wrap .list-item")

任何帮助是极大的赞赏。谢谢。

评论