What is the $ symbol used for in JavaScript

It doesn’t mean anything special.

But because $ is allowed in identifier names, many Javascript libraries have taken to using $ as the “central” interface to them, or at least as a shortcut for accessing their functionality.

For example, if you’re using jQuery and you say $("div"), this is a call to the $ function with argument “div”. When you say $.post(), it’s calling the post method on the $ object (Javascript is nice in that functions are first-class objects).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)