Skip to content

Instantly share code, notes, and snippets.

@fillano
Created March 5, 2014 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fillano/9372441 to your computer and use it in GitHub Desktop.
Save fillano/9372441 to your computer and use it in GitHub Desktop.
getting started example from traceur-compiler
<!DOCTYPE html>
<html>
<body>
<script src="https://traceur-compiler.googlecode.com/git/bin/traceur.js"
type="text/javascript"></script>
<script src="https://traceur-compiler.googlecode.com/git/src/bootstrap.js"
type="text/javascript"></script>
<script>
traceur.options.experimental = true;
</script>
<script type="module">
class Greeter {
constructor(message) {
this.message = message;
}
greet() {
let element = document.querySelector('#message');
element.innerHTML = this.message;
}
};
let greeter = new Greeter('Hello, world!');
greeter.greet();
</script>
<div id="message"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment