If you really just love $() you can add this line to your JS
$()
const $ = selector => document.querySelector(selector);
or this one if you don't want to compile to es5
function $(selector) { return document.querySelector(selector); }
And remove JQuery as it's overkill to have your user download a whole library if that's all you want XD
Thats a great tip Alan! I agree that it is overkill and I haven't used it for a number of years. I think when I stopped using it I became a better developer and got a much better understanding of js.
const $ = document.querySelectorAll.bind(document)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you really just love
$()
you can add this line to your JSor this one if you don't want to compile to es5
And remove JQuery as it's overkill to have your user download a whole library if that's all you want XD
Thats a great tip Alan! I agree that it is overkill and I haven't used it for a number of years. I think when I stopped using it I became a better developer and got a much better understanding of js.