Tag: Variable obfuscation occupies this copy of Unicode encoded object sequence elements

Doubtful point:

1.16position

2.Immutable

3.Ordered sequence

 

Dispel:

1.16Bit refers to: Each character in a string occupies 16 bits of space (2 bytes); this is because JS uses Unicode encoding, each character requires 2 characters.

2.Immutability refers to:

  • Once the string object is created, it cannot be changed. This may be hard to understand, but it is indeed true. You might thinks+=‘1‘ It’s just ins Add an element later.1 But the fact is:

    • First copy a copy of S, and record it as temp.

    • Add “1” at the end of temp.

    • Point the s variable to temp and delete the original s.

  • This feature can be seen from many methods of string objects, such as replace, which does not modify the original string object, but returns a new string

3.Ordered sequence refers to the fact that the string itself is an array, which can be indexed from the bottom table and start from 0.

How to understand “string is a set of immutable ordered sequences composed of 16 bits”.

Tag: Variable obfuscation occupies this copy of Unicode encoded object sequence elements

Original address: http://www.cnblogs.com/Steeland/p/6980208.html

Similar Posts:

Leave a Reply

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