Skip to content

Commit 188c93f

Browse files
committed
Improve output
1 parent 284692e commit 188c93f

File tree

7 files changed

+14
-3
lines changed

7 files changed

+14
-3
lines changed

JavaScript/3-class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ p1.move(-5, 10);
3737

3838
console.log(p1);
3939
console.log(p1.toString());
40-
console.log(p1 + '');
40+
console.log(`${p1}`);

JavaScript/4-closure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ p1.move(-5, 10);
1818

1919
console.log(p1);
2020
console.log(p1.toString());
21-
console.log(p1 + '');
21+
console.log(`${p1}`);

JavaScript/5-bind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ p1move(-5, 10);
1616

1717
console.log(p1);
1818
console.log(p1toString());
19-
console.log(p1 + '');
19+
console.log(`${p1}`);

JavaScript/9-inherits.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ Object.setPrototypeOf(Square.prototype, Rect.prototype);
2727
// Square.prototype.constructor = Square;
2828

2929
const p1 = new Square(10, 20, 50);
30+
31+
console.log(p1);
3032
console.log(p1.toString());
33+
console.log(`${p1}`);

JavaScript/a-class.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ class Square extends Rect {
2020
}
2121

2222
const p1 = new Square(10, 20, 50);
23+
24+
console.log(p1);
2325
console.log(p1.toString());
26+
console.log(`${p1}`);

JavaScript/b-set.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ const p1 = { x: 10, y: 20, width: 50, height: 50 };
1010
Object.setPrototypeOf(p1, Rect.prototype);
1111
//p1.__proto__ = Rect.prototype;
1212

13+
console.log(p1);
1314
console.log(p1.toString());
15+
console.log(`${p1}`);

JavaScript/c-alternative.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ function Rect(x, y, width, height) {
1111
}
1212

1313
const p1 = new Rect(10, 20, 50, 50);
14+
15+
console.log(p1);
1416
console.log(p1.toString());
17+
console.log(`${p1}`);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy