Skip to content

Commit f00d69c

Browse files
Added JavaScript test files.
1 parent 888996b commit f00d69c

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
export function Add(a, b) {
5+
return a + b;
6+
}
7+
8+
export function Subtract(a, b) {
9+
return a - b;
10+
}
11+
12+
export function Multiply(a, b) {
13+
return a * b;
14+
}
15+
16+
export function Divide(a, b) {
17+
return a / b;
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
import * as Arithmetic from '../Arithmetic/Arithmetic.js';
5+
6+
export class Rectangle {
7+
constructor(width, height) {
8+
this.width = width;
9+
this.height = height;
10+
}
11+
get Area() {
12+
return Arithmetic.Multiply(this.width, this.height);
13+
}
14+
}
15+
16+
export class Square extends Rectangle {
17+
constructor(side) {
18+
super(side, side);
19+
}
20+
};

0 commit comments

Comments
 (0)