(2.4.5) Is the length of […”11111″] becomes 1 instead of 5?


Hi, when trying to evaluate the length of […“11111”] in Cocos Creator 2.4.5, it seems become 1 instead of 5, is it normal?

So, just trying to show the […“11111”].length at Cocos Creator 2.4.5:

onEnable(){
    alert([..."11111"].length);
}

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:


it shows 5, which is my expected output. Is it the bug of Cocos Creator 2.4.5?



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *