diff options
Diffstat (limited to 'typescript.html.markdown')
| -rw-r--r-- | typescript.html.markdown | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/typescript.html.markdown b/typescript.html.markdown index 640be0cd..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,9 +137,9 @@ class Point3D extends Point {    }    // Overwrite -  dist() { +  dist(): number {      let d = super.dist(); -    return Math.sqrt(d() * d() + this.z * this.z); +    return Math.sqrt(d * d + this.z * this.z);    }  } | 
