Please explain the meaning of the $ and $$
This is sample code use $ and $$: https://github.com/cytoscape/cytoscape.js-qtip/blob/master/cytoscape-qtip.js
what mean this code use $:
JavaScript
x
2
1
var $qtipContainer = $('<div></div>');
2
Advertisement
Answer
The whole code is just a function call with two arguments:
JavaScript
1
7
1
;(function( $, $$ ){ 'use strict';
2
// skipped
3
})(
4
typeof jQuery !== 'undefined' ? jQuery : null,
5
typeof cytoscape !== 'undefined' ? cytoscape : null
6
);
7
The first argument is jQuery
global variable (or null
, if jQuery
is undefined), and the second is cytoscape
global variable (or null
, if is undefined).