We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d494e8 commit 7c373b0Copy full SHA for 7c373b0
ECMAScript/A07-Module/export.js
@@ -0,0 +1,15 @@
1
+export const PI = Math.PI;
2
+
3
+export function degreesToRadians(degree) {
4
+ return degree * PI / 180;
5
+}
6
7
+export class Circle {
8
+ constructor(radius) {
9
+ this.radius = radius;
10
+ }
11
12
+ area() {
13
+ return PI * this.radius * this.radius;
14
15
ECMAScript/A07-Module/import.js
@@ -0,0 +1,8 @@
+import {PI, Circle, degreesToRadians} from "./export.js";
+let radian = degreesToRadians(90);
+console.log(radian);
+let myCircle = new Circle(2);
+let myArea = myCircle.area();
+console.log("myArea: " + myArea);
ECMAScript/A07-Module/package.json
@@ -0,0 +1,7 @@
+{
+ "name": "A07-Module",
+ "version": "1.0.0",
+ "type": "module",
+ "dependencies": {
0 commit comments