Difference in listing variables in JavaScript [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Declaring Multiple Variables in JavaScript I was wondering whether there is a difference in listing variables in JavaScript (and JS libraries). Example : var $this = $(this), $body = $("body"), $main-wrap = $("body > section.wrapper"); OR var $this = $(this); var $body = $("body"); var $main-wrap = $("body > section.wrapper"); I always thought that the difference only lies in notation. The first example is