Babelã§declareã¯ã©ã¹ãã£ã¼ã«ãã使ãããã«allowDeclareFieldsã¨ãããªãã·ã§ã³ãããã¾ããä¸è¦ããã¨åã«è¨å®ã§ãããæå¹åããã°ãããããªæ°ããã¾ãããå®ã¯æ£ãããã®è¨å®ãæå¹åããã«ã¯ç½ ãããã¾ãããæ¬è¨äºã§ã¯Babelã¨TypeScriptã®ã¯ã©ã¹ãã£ã¼ã«ããµãã¼ããç´è§£ããæ£ããç解ã«ãã¨ã¥ãã¦é©åãªè¨å®ãç´¹ä»ãã¾ãã ã¯ã©ã¹ãã£ã¼ã«ãã¨ã¯ã¯ã©ã¹ãã£ã¼ã«ãã¯JavaScriptã®Stage 3ææ¡ã§ãã¯ã©ã¹ã®ç´ä¸ã«å¤æ°å®£è¨ã®ãããªè¨æ³ã§ã¤ã³ã¹ã¿ã³ã¹å¤æ°ãã¯ã©ã¹å¤æ°ã«ç¸å½ãã宣è¨ãè¡ããã¨ãããã®ã§ãã class C { x; y = 42; static a; static b = 42; } console.log(new C().y); // => 42 console.log(C.b); // => 42TypeScriptã§ã¯åå®ç¾©ã修飾åã¨ã¨ã
{{#tags}}- {{label}}
{{/tags}}