Created
July 15, 2020 05:06
-
-
Save tonkotsuboy/5f4d9149a225b2ed6e325e320005a1e5 to your computer and use it in GitHub Desktop.
Chrome 84のプライベートメソッドとアクセサ
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 Fukuoka { | |
get #ramen() { | |
return "ラーメン"; | |
} | |
#sayHello() { | |
console.log(`${this.#ramen}はえらい美味しかばい`); | |
} | |
constructor() { | |
this.#sayHello(); | |
} | |
} | |
const fukuoka = new Fukuoka(); // OK | |
// fukuoka.#sayHello(); // NG! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment