What does $$ mean in Javascript?

前端 未结 6 1784
别那么骄傲
别那么骄傲 2021-01-06 17:17

I am looking at some javascript code and it has this in a function:

$$(\'.CssClass\').each(function(x) { .... } )

I get that the intent is

6条回答
  •  天命终不由人
    2021-01-06 17:50

    $ is an ordinary symbol character, thus "$", "$$", "$$$" are ordinary variables.

    the meaning of $ depends upon the libraries that are in use; in jQuery the $-function creates a jquery object from a css selector, e.g. $("DIV") is a collection of all DIVs in the current document.

提交回复
热议问题