Intro ECMAScript ã® Private Class Field ã®ä»æ§çå®ã¨åãã©ã¦ã¶ã®å®è£ ãé²ãã§ããã ããã«ãããå¾æ¥ã® JS ã«ã¯ãªãã£ã Class ã® Private ãã£ã¼ã«ãã使ããããã«ãªãã ææ¡ããã¦ããæ§æããæåã«ã¤ãã¦è§£èª¬ããã Class Field Declaration ã¾ãåæã¨ãã¦ãç¾ç¶ã® Class ã® ãã£ã¼ã«ãã¯ã³ã³ã¹ãã©ã¯ã¿ã§å®ç¾©ããå¿ è¦ãããã ä¾ãã° count ãã£ã¼ã«ããæ㤠Counter ã¯ã©ã¹ãå®ç¾©ããå ´åã以ä¸ã®ããã«ãªãã class Counter { constructor() { this.count = 0 } increment() { this.count ++ } display() { console.log(this.count) } } const c = new Counter() c.in
{{#tags}}- {{label}}
{{/tags}}