File tree Expand file tree Collapse file tree
ClearScriptTest/JavaScript Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ } ;
You can’t perform that action at this time.
0 commit comments