|
|
|
The following steps are taken: 1. Let S be the this value. 2. Return ? S , end ). NOTE This function interprets a String value as a sequence of UTF-16 encoded code points, as described in The following steps are taken: 1. Let S be the this value. 2. Return ? S , start ). NOTE When the valueOf valueOf method is called, the following steps are taken: 1. Return ? ( this value). When the @@iterator @@iterator method is called it returns an Iterator object ( ) that iterates over the code points of a String value, returning each code point as a String value. The following steps are taken: 1. Let O be ? this value). 2. Let s be ? ( O ). 3. Let closure with no parameters that captures s and performs the following steps when called: a. Let position be 0. b. Let len be the length of s . c. Repeat, while position < len , i. Let cp s , position ). ii. Let nextIndex be position + cp .[[CodeUnitCount]]. iii. Let resultString of s from position to nextIndex . iv. Set position to nextIndex . v. Perform ? ( resultString ). d. Return undefined . 4. Return ! ( closure , "%StringIteratorPrototype%" The value of the "name" property of this function is "[Symbol.iterator]" . The trimEnd trimEnd function is intentionally generic; it does not require that its this value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method. The trimStart trimStart function is intentionally generic; it does not require that its this value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method. 22.1.3.31 String.prototype.trimStart ( ) 22.1.3.32 String.prototype.valueOf ( ) 22.1.3.33 String.prototype [ @@iterator ] ( ) 573 |