Skip to content

Commit c5e96e6

Browse files
committed
EcmaScript 2016 (ES7): Exponentiation operator
1 parent 9000633 commit c5e96e6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head lang="en">
4+
<meta charset="UTF-8">
5+
<title></title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="18-ES2016-ES7-ExponentiationOperator.js"></script>
9+
</body>
10+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @ts-check
2+
3+
//* ****** EcmaScript 2016 (ES7): Exponentiation operator (https://goo.gl/Z6dCFB)
4+
let r = 2;
5+
const area = 3.14 * r * r;
6+
const area2 = 3.14 * Math.pow(r, 2);
7+
const area3 = 3.14 * r ** 2;
8+
9+
console.log(area);
10+
console.log(area2);
11+
console.log(area3);

0 commit comments

Comments
 (0)