summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMax Schumacher <maximilianbschumacher@gmail.com>2020-08-17 16:13:16 +0200
committerGitHub <noreply@github.com>2020-08-17 16:13:16 +0200
commit3e4fc3f2a8e8cf6cdd48a3dd0ebe7ffbb913183e (patch)
tree330e53cfe3e549b64933c4a9b6a0d1560a175d15
parent6fb66a825b8c7f9bb4051843d24ead74d5c7152c (diff)
parentd0e82c10cd98e82100f3efac298d24d4d58ded9e (diff)
Merge pull request #3890 from vitiral/ts-fixes
[typescript/en-us] add type to Point.dist and fix error
-rw-r--r--typescript.html.markdown4
1 files changed, 2 insertions, 2 deletions
diff --git a/typescript.html.markdown b/typescript.html.markdown
index 7e857cc0..f7a41ce1 100644
--- a/typescript.html.markdown
+++ b/typescript.html.markdown
@@ -114,7 +114,7 @@ class Point {
}
// Functions
- dist() { return Math.sqrt(this.x * this.x + this.y * this.y); }
+ dist(): number { return Math.sqrt(this.x * this.x + this.y * this.y); }
// Static members
static origin = new Point(0, 0);
@@ -137,7 +137,7 @@ class Point3D extends Point {
}
// Overwrite
- dist() {
+ dist(): number {
let d = super.dist();
return Math.sqrt(d * d + this.z * this.z);
}