Yes, they share the same global variables and doing so is one of the accepted ways to do modules in Javascript
<script src="jquery.js"></script> <!-- Include the jQuery library.
Creates a global jQuery variable -->
<script src="mycode.js"></script> <!-- code uses the jQuery
via that global variable -->
Do note that since global variables are shared, when writing your own scripts you should try your best to only use globals only when strictly necessary, in order to avoid accidental naming clashes.
A common pattern is wrapping your code inside an immediately invoked function in order to turn things into local variables instead of globals.
//instead of littering the global namespace
var myVar = /*...*/
function f1(){ /*...*/ }
function f2(){ /*...*/ }
//Put the related stuff in a namespaced module.
var myModule = (function(){
var myVar = /*...*/
function f1(){ /*...*/ }
function f2(){ /*...*/ }
return {
f1: f1,
f2: f2
};
}());
//myModule is now a global "namespace" object containing just your public
// stuff inside it.