Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save djD-REK/6108ecbb9c688bcb67de9e4f3944507e to your computer and use it in GitHub Desktop.
Save djD-REK/6108ecbb9c688bcb67de9e4f3944507e to your computer and use it in GitHub Desktop.
console.log($) // function()
console.log(typeof $) // "function"
console.log($()) // null
console.log(typeof $()) // "object"
try {
console.log($().jquery)
console.log(typeof $().jquery)
} catch (e) {
console.log(e)
} // TypeError: "$() is null"
// In jQuery, $() is an alias of jQuery():
try {
console.log(jQuery)
console.log(typeof jQuery)
console.log(jQuery())
console.log(typeof jQuery())
console.log(jQuery().jquery)
console.log(typeof jQuery().jquery)
} catch (e) {
console.log(e)
} // ReferenceError: "jQuery is not defined"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment