-
Notifications
You must be signed in to change notification settings - Fork 8
/
modules.html
33 lines (30 loc) · 868 Bytes
/
modules.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
<!-- Open this file in any modern browser -->
<!DOCTYPE html>
<html>
<head>
<title>ES6 Modules</title>
<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>
</head>
<body>
<script type="text/traceur">
// ES6
module circle {
export var pi = 3.141;
export function area(radius) {
return "Area of Circle with radius " + radius + " is " + (pi * radius * radius);
}
export function circumference(radius) {
return "Circumference of Circle with radius " + radius + " is " + (2 * pi * radius);
}
}
console.log( circle.area(3) );
console.log( circle.circumference(2) );
</script>
</body>
</html>