class Name1 {
static method1() {
console.log(1);
}
}
class Name2 {
method2() {
Name1.method1();
}
}
const N2 = new Name2();
N2.method2()
class Name1 {
method1() {
console.log(1);
}
}
class Name2 {
constructor(name1) {
this.name1 = name1;
}
method2() {
this.name1.method1();
}
}
const name2 = new Name2(new Name1());
name2.method2()