0

What's the meaning of $$("a") in JavaScript?, Is that something relevant to jQuery?

Typed it into browser's console, it works.

Sinto
  • 3,915
  • 11
  • 36
  • 70
HIPPO LD
  • 477
  • 5
  • 20
  • @LucaKiebel Yeah, thanks. – HIPPO LD Aug 30 '18 at 10:12
  • 1
    That's Google's [Command Line API](https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference). `$` is `document.querySelector`, `$$` is `document.querySelectorAll`, though relying on that behavior for `$` is a bad idea because on many sites it will be replaced by jQuery. – riv Aug 30 '18 at 10:12
  • 1
    Possible Duplicate of https://stackoverflow.com/questions/1463867/javascript-double-dollar-sign – Muhammad Osama Aug 30 '18 at 10:13
  • All the linked dup questions are discussing specific libraries that have functions w/ `$$`. Was OP referring to those libs or to the "build-in" expression in Chrome? (Or another popular browser)? – just.another.programmer Aug 30 '18 at 10:15
  • The second link answers OP's question. – riv Aug 30 '18 at 10:18
  • @riv The second link is a different question that happens to also have an answer to this question. – just.another.programmer Aug 30 '18 at 11:30

1 Answers1

3

In Chrome $$ is an alias for document.querySelectorAll. Learn more on the expressions page.

just.another.programmer
  • 8,579
  • 8
  • 51
  • 90