-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.mjs
60 lines (48 loc) · 1005 Bytes
/
example.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
export function someFunction() {
console.log('Hello from someFunction!');
}
export const add= (a,b)=>{
return a+b
}
export class Animal{
constructor(type,color){
this.type= type;
this.color= color;
}
makeNoise(sound= 'roar'){
console.log(sound);
}
get metadata(){
return `Type: ${this.type} and Color: ${this.color}`
}
static return10(){
return 10;
}
}
export class Cat extends Animal{
constructor(type,color, tail){
super(type,color);
this.tail= tail;
}
makeNoise(sound= 'meow'){
console.log(sound);
}
}
export class Player{
constructor(Name, Country){
this.name= Name;
this.country= Country;
}
detail(){
console.log(`${this.name} was born in ${this.country}`);
}
}
export class TennisPlayer extends Player{
constructor(Name, Country,Age){
super(Name, Country);
this.age= Age;
}
tennisdetail(){
console.log(`${this.name} is ${this.age} years old and knows how to play Tennis`)
}
}