{"id":1311,"date":"2026-09-10T18:10:29","date_gmt":"2026-09-10T18:10:29","guid":{"rendered":"https:\/\/x.sheep-mine.ts.net\/index.php\/63960post_1\/"},"modified":"2026-09-10T18:10:29","modified_gmt":"2026-09-10T18:10:29","slug":"63960post_1","status":"publish","type":"post","link":"https:\/\/x.sheep-mine.ts.net\/index.php\/63960post_1\/","title":{"rendered":"(2.4.5) Is the length of [&#8230;&#8221;11111&#8243;] becomes 1 instead of 5?"},"content":{"rendered":"<p><br \/>\n<\/p>\n<div id=\"post_1\">\n<div class=\"crawler-post-meta\">\n              <span class=\"creator\" itemprop=\"author\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Person\"><br \/>\n                <a rel=\"nofollow\" target=\"_blank\" itemprop=\"url\" rel=\"nofollow\" href=\"https:\/\/forum.cocosengine.org\/u\/ahmfg\"><span itemprop=\"name\">ahmfg<\/span><\/a><\/p>\n<p>              <\/span><\/p>\n<link itemprop=\"mainEntityOfPage\" href=\"https:\/\/forum.cocosengine.org\/t\/2-4-5-is-the-length-of-11111-becomes-1-instead-of-5\/63960\"\/>\n<p>              <span class=\"crawler-post-infos\"><br \/>\n                  <time datetime=\"2026-08-03T01:46:27Z\" class=\"post-time\"><br \/>\n                    August 3, 2026,  1:46am<br \/>\n                  <\/time><br \/>\n                  <meta itemprop=\"dateModified\" content=\"2026-08-03T01:46:27Z\"\/><br \/>\n              <span itemprop=\"position\">1<\/span><br \/>\n              <\/span>\n            <\/div>\n<div class=\"post\" itemprop=\"text\">\n<p>Hi, when trying to evaluate the length of [\u2026\u201c11111\u201d] in Cocos Creator 2.4.5, it seems become 1 instead of 5, is it normal?<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<div id=\"post_2\" itemprop=\"comment\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Comment\">\n<div class=\"crawler-post-meta\">\n              <span class=\"creator\" itemprop=\"author\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Person\"><br \/>\n                <a rel=\"nofollow\" target=\"_blank\" itemprop=\"url\" rel=\"nofollow\" href=\"https:\/\/forum.cocosengine.org\/u\/ahmfg\"><span itemprop=\"name\">ahmfg<\/span><\/a><\/p>\n<p>              <\/span><\/p>\n<p>              <span class=\"crawler-post-infos\"><br \/>\n                  <time itemprop=\"datePublished\" datetime=\"2026-08-03T01:50:00Z\" class=\"post-time\"><br \/>\n                    August 3, 2026,  1:50am<br \/>\n                  <\/time><br \/>\n                  <meta itemprop=\"dateModified\" content=\"2026-08-03T01:50:00Z\"\/><br \/>\n              <span itemprop=\"position\">2<\/span><br \/>\n              <\/span>\n            <\/div>\n<div class=\"post\" itemprop=\"text\">\n<p>So, just trying to show the [\u2026\u201c11111\u201d].length at Cocos Creator 2.4.5:<\/p>\n<pre><code class=\"lang-auto\">onEnable(){\n    alert([...\"11111\"].length);\n}\n<\/code><\/pre>\n<p>I expect it shows 5, but actually it shows 1 instead of 5, but when creating a new .html and opening it with my currently using browser:<\/p>\n<pre><code class=\"lang-auto\"><script><![CDATA[\nalert([...\"11111\"].length);\n]]><\/script>\n<\/code><\/pre>\n<p>it shows 5, which is my expected output. Is it the bug of Cocos Creator 2.4.5?<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><br \/>\n<br \/><a href=\"https:\/\/forum.cocosengine.org\/t\/2-4-5-is-the-length-of-11111-becomes-1-instead-of-5\/63960#post_1\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ahmfg August 3, 2026, 1:46am 1 Hi, when trying to evaluate the length of [\u2026\u201c11111\u201d]&#8230;<\/p>\n","protected":false},"author":1,"featured_media":305,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts\/1311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/comments?post=1311"}],"version-history":[{"count":0,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/posts\/1311\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/media\/305"}],"wp:attachment":[{"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/media?parent=1311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/categories?post=1311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/x.sheep-mine.ts.net\/index.php\/wp-json\/wp\/v2\/tags?post=1311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}