Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Point {
- constructor(x1, x2) {
- this.x1 = x1;
- this.x2 = x2;
- }
- get distance() {
- return (this.x1 ** 2 + this.x2 ** 2) ** 0.5;
- }
- static distance(x1, x2) {
- return (x1 ** 2 + x2 ** 2) ** 0.5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement