ãN æåä»¥ä¸ / 以å ãã¿ãããªãã¨ãè¨ãããã¨ãã«èãããã¨. ãæåãã¨ã¯? åã«ãæåãã¨è¨ã£ã¦ã, ãããæãã¦ãããã®ãä½ãã¯èªæã§ã¯ãªã. 符å·åä½ (code unit) JavaScript ã®å ´å, æåå㯠UTF-16 ã¨ãã¦ã¨ã³ã³ã¼ãããã¦ãã*1ã®ã§, ãã®ã¨ã³ã³ã¼ãã®åä½ã§ãã 16 bit ãã¨ã«åå²ããã¨ããã®ããã®æ¹æ³. .length ã§åå¾ã§ããã®ã¯ãã®ç¬¦å·åä½ã®æ°ã§, .slice() ã«ä¸ããã®ã符å·åä½ã§æ°ããã¤ã³ããã¯ã¹ã¨ãªã£ã¦ãã. > "ãããããABCDE".length 10 > "ãããããABCDE".slice(0, 5) "ããããã" ã¨ãã㧠Unicode ã«ã¯ 16 bit ã§è¡¨ããæ°ä»¥ä¸ã®ãæåã (U+0000 ã U+10FFFF) ãå«ã¾ããã®ã§, UTF-16 ã§ã¯ 1 ã¤ã®ç¬¦å·åä½ã§è¡¨ããªããæåã㯠2
{{#tags}}- {{label}}
{{/tags}}