前面那几个是操作字符串的,嗯,字符串也可以看成类数组对象。但是后面那个 b 对象居然 也是类数组对象。 看书上的解释: 复制代码 代码如下: So what exactly makes an object “array-like”? The basic contract of an array object amounts to two simple rules. It has an integer length property in the range 0...2^32 – 1. The length property is greater than the largest index of the object. An index is an integer in the range 0...2^32 – 2 whose string representation is the key of a property of the object.