Created
March 29, 2012 17:34
-
-
Save jessecravens/2240458 to your computer and use it in GitHub Desktop.
JavaScript Modules - harmony
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
Loader.load('http://json.org/modules/json2.js', | |
function(JSON) { | |
console.log(JSON.stringify([0, {a: true}])); | |
}); |
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
<script type=”harmony”> | |
// loading from a URL | |
module JSON at 'http://json.org/modules/json2.js'; | |
console.log(JSON.stringify({'hi': 'world'})); |
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
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