Skip to content

Instantly share code, notes, and snippets.

@jessecravens
Created March 29, 2012 17:34
Show Gist options
  • Save jessecravens/2240458 to your computer and use it in GitHub Desktop.
Save jessecravens/2240458 to your computer and use it in GitHub Desktop.
JavaScript Modules - harmony
Loader.load('http://json.org/modules/json2.js',
function(JSON) {
console.log(JSON.stringify([0, {a: true}]));
});
<script type=”harmony”>
// loading from a URL
module JSON at 'http://json.org/modules/json2.js';
console.log(JSON.stringify({'hi': 'world'}));
module math {
export function sum(x, y) {
return x + y;
}
export var pi = 3.141593;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment