cara mengakses variabel dalam file skrip yang berbeda
// first.js...(first script file)
var colorCodes = {
back : "#fff",
front : "#888",
side : "#369"
};
//in another file...(second script file)
alert(colorCodes.back); // alerts `#fff`
//in your html...
<script type="text/javascript" src="first.js"></script>
<script type="text/javascript" src="second.js"></script>
Curious Cicada