This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 类模式 | |
class MyClass { | |
constructor(a, b) { | |
this.a = a; | |
this.b = b; | |
this.result = 0; | |
} | |
calculate() { | |
this.result = this.a + this.b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const C = 20_000_000; | |
async function* AG() { | |
const ret = []; | |
for (let i = 0; i < C; i++) { | |
ret.push(i); | |
} | |
for (const item of ret) { | |
yield item; | |
} |