Created
June 16, 2020 03:44
-
-
Save djD-REK/cc3ecf89ee2acc5f716cf41873935a70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enter these commands into the console to load jQuery first. | |
// <script src="https://code.jquery.com/jquery-3.5.0.js"></script> | |
const scriptSource = "https://code.jquery.com/jquery-3.5.0.js" | |
document.write(`<script src="${scriptSource}" type="text/javascript"></script>`) | |
// Then, enter the following commands separately: | |
console.log($) // function jQuery(selector, context) | |
console.log(typeof $) // "function" | |
console.log($()) // Object { } | |
console.log(typeof $()) // "object" | |
try { | |
console.log($().jquery) // "3.5.0" | |
console.log(typeof $().jquery) // "string" | |
} catch (e) { | |
console.log(e) | |
} | |
// Equivalent to: | |
try { | |
console.log(jQuery) // function jQuery(selector, context) | |
console.log(typeof jQuery) // "function" | |
console.log(jQuery()) // Object | |
console.log(typeof jQuery()) // "object" | |
console.log(jQuery().jquery) // "3.5.0" | |
console.log(typeof jQuery().jquery) // "string" | |
} catch (e) { | |
console.log(e) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment