-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
36 lines (32 loc) · 992 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<title>Using Babel in the browser without transpilation</title>
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="node_modules/babel-core/browser.js"></script>
<script src="node_modules/babel-core/browser-polyfill.js"></script>
</head>
<body>
<h1>Example output:</h1>
<div id="output"></div>
<script type="text/ecmascript-6">
class Greeter {
constructor(message) {
this.message = message;
}
getMessage() {
return "An instance of class " + this.constructor.name + " says: " + this.message;
}
}
class DerivedGreeter extends Greeter {
constructor(message) {
super(message + " !");
}
}
let aGreeter = new DerivedGreeter("Hello world");
let message = aGreeter.getMessage();
var aSet = new Set([10, 20, 30, 40, 50, 10, 20, 30]);
$("#output").html(message + "<br /> The example set size is " + aSet.size);
</script>
</body>
</html>