Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript $ symbol? [closed]

Tags:

javascript

why $ symbol is used in javascript? i want to know what it specify?

like image 710
Ajay Yadav Avatar asked Apr 24 '11 00:04

Ajay Yadav


People also ask

What does $() mean in JavaScript?

The $() function The dollar function, $(), can be used as shorthand for the getElementById function. To refer to an element in the Document Object Model (DOM) of an HTML page, the usual function identifying an element is: document.

What is the symbol => in JavaScript?

It's an arrow function, newly defined in ES6. An arrow function expression has a shorter syntax than a function expression and does not bind its own this, arguments, super, or new. target. Arrow functions are always anonymous.

What is the closure in JavaScript?

A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function.

What are JavaScript symbols?

Symbol is a primitive data type of JavaScript, along with string, number, boolean, null and undefined. It was introduced in ECMAScript 2015, so just a few years ago. It's a very peculiar data type. Once you create a symbol, its value is kept private and for internal use.


1 Answers

You may be looking at jQuery code. $ is a variable (in jQuery's case it's a shortcut for 'jQuery').

like image 182
Paul Avatar answered Nov 04 '22 01:11

Paul