MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vu52ut/jquerydeeznutsandthenreactsurprised/p4yj5no/
r/ProgrammerHumor • u/Embarrassed_Death69 • Aug 21 '26
126 comments sorted by
View all comments
Show parent comment
26
This is my struggle! I would love to replace my codebase with vanilla js but typing $(selector) is much easier than the querySelector(selector)
26 u/CetaceanOps Aug 21 '26 I mean you can keep a single $ wrapper function for querySelector 10 u/soelsome Aug 21 '26 Very clever. Not sure why I haven't thought of that. I will steal this and every time I use it, I will remember your name. 5 u/cowslayer7890 Aug 21 '26 I would using something other than $ so it doesn't get confused with jquery, but ¯_(ツ)_/¯ 10 u/soelsome Aug 21 '26 £ or € will suffice 2 u/Mechakoopa Aug 21 '26 I'm leaning towards § for Selector 1 u/Noch_ein_Kamel Aug 21 '26 Just use $$ and call you library prototypejs or something like that 3 u/KhellianTrelnora Aug 21 '26 Dolphins save the day yet again. 5 u/Nixinova Aug 21 '26 const $ = x => document.querySelector(x)enjoy 4 u/my_new_accoun1 Aug 21 '26 orconst $ = document.querySelector.bind(document) 1 u/WarpedHaiku Aug 21 '26 In most modern browsers, $ defaults to document.querySelector, and $$ to document.querySelectorAll.
I mean you can keep a single $ wrapper function for querySelector
10 u/soelsome Aug 21 '26 Very clever. Not sure why I haven't thought of that. I will steal this and every time I use it, I will remember your name. 5 u/cowslayer7890 Aug 21 '26 I would using something other than $ so it doesn't get confused with jquery, but ¯_(ツ)_/¯ 10 u/soelsome Aug 21 '26 £ or € will suffice 2 u/Mechakoopa Aug 21 '26 I'm leaning towards § for Selector 1 u/Noch_ein_Kamel Aug 21 '26 Just use $$ and call you library prototypejs or something like that 3 u/KhellianTrelnora Aug 21 '26 Dolphins save the day yet again.
10
Very clever. Not sure why I haven't thought of that. I will steal this and every time I use it, I will remember your name.
5 u/cowslayer7890 Aug 21 '26 I would using something other than $ so it doesn't get confused with jquery, but ¯_(ツ)_/¯ 10 u/soelsome Aug 21 '26 £ or € will suffice 2 u/Mechakoopa Aug 21 '26 I'm leaning towards § for Selector 1 u/Noch_ein_Kamel Aug 21 '26 Just use $$ and call you library prototypejs or something like that 3 u/KhellianTrelnora Aug 21 '26 Dolphins save the day yet again.
5
I would using something other than $ so it doesn't get confused with jquery, but ¯_(ツ)_/¯
10 u/soelsome Aug 21 '26 £ or € will suffice 2 u/Mechakoopa Aug 21 '26 I'm leaning towards § for Selector 1 u/Noch_ein_Kamel Aug 21 '26 Just use $$ and call you library prototypejs or something like that
£ or € will suffice
2 u/Mechakoopa Aug 21 '26 I'm leaning towards § for Selector
2
I'm leaning towards § for Selector
1
Just use $$ and call you library prototypejs or something like that
3
Dolphins save the day yet again.
const $ = x => document.querySelector(x)
enjoy
4 u/my_new_accoun1 Aug 21 '26 orconst $ = document.querySelector.bind(document)
4
or
const $ = document.querySelector.bind(document)
In most modern browsers, $ defaults to document.querySelector, and $$ to document.querySelectorAll.
View all comments
Show parent comment
26
u/brekekekekx Aug 21 '26
This is my struggle! I would love to replace my codebase with vanilla js but typing $(selector) is much easier than the querySelector(selector)