What does $$ mean in Javascript?

前端 未结 6 1779
别那么骄傲
别那么骄傲 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:47

    $ is a valid function name in javascript. So something defines a function $$ that takes a string looking for some class called .CssClass and returns a object where you call each on.

    I know that jQuery defines a function called $ at least that does similar things.

提交回复
热议问题