3 ms·
That's pretty much what that include file does, but with "dqs" rather than "$". I'm not a fan of using the $ as it might confuse others that you're using JQuer
by gmiller123456 3y ago
That's pretty much what that include file does, but with "dqs" rather than "$". I'm not a fan of using the $ as it might confuse others that you're using JQuery.
- bambax 3y agoWouldn't that be a feature? ;-)
- chrismorgan 3y ago$ is what I would expect and prefer, because it’s what I’ve been using in my browser dev tools for over fifteen years (ah, Firebug; fond reminiscences). If your document doesn’t use the names, you’ll get implementations roughly equivalent to these: function $(selector, element = document) { return element.querySelector(selector); } function $$(selector, element = document) { return Array.from(element.querySelectorAll(selector)); } Reference on more magic available in the console (there’s a lot of good stuff): • https://firefox-source-docs.mozilla.org/devtools-user/web_console/helpers/index.html https://firefox-source-docs.mozilla.org/devtools-user/web_co... (I think “:help” is my new favourite: opens that URL, which is not particularly discoverable) • https://developer.chrome.com/docs/devtools/console/utilities/ https://developer.chrome.com/docs/devtools/console/utilities...