Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (23 sloc) 619 Bytes
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: Access to the Global Object
* Description: access the global object without hard-coding the identifier window
*/
// access to the Global Object
// this should work in ES3, ES5 and ES5-strict.
var global = (function (g) {
return g;
})(this);
// Test Cases
// http://jsperf.com/globalx/7
// References
// http://net.tutsplus.com/tutorials/javascript-ajax/the-essentials-of-writing-high-quality-javascript/
</script>
</body>
</html>