2.1.67 [ECMA-262-1999] Section 18.104.22.168, Array.prototype.join (separator)
The elements of the array are converted to strings, and these strings are then concatenated, separated by occurrences of the separator. If no separator is provided, a single comma is used as the separator.
In JScript 5.7, if the value undefined is explicitly provided as the separator argument, the string "undefined" is used as the separator.
The join method takes one argument, separator, and performs the following steps:
(The bulleted steps are added before step 1)
__Let O be the result of calling ToObject with the this value as the argument.__
__If O is a host object, throw a TypeError exception.__
Call the [[Get]] method of __O__ #this object# with argument "length".
__If JScript 5.7 and the separator argument is not present, let separator be the single character ",".__
__If JScript 5.7, go to step 4.__
If separator is undefined, let separator be the single-character string ",".
If Result(2) is zero, return the empty string.
Call the [[Get]] method of __O__ #this object# with argument "0".
If Result(6) is undefined or null, use the empty string; otherwise, call ToString(Result(6)). __If the call to ToString would cause a non-terminating recursion use the empty string as the result of this step.__
Let R be Result(7).
Let k be 1.
If k equals Result(2), return R.
Let S be a string value produced by concatenating R and Result(4).
Call the [[Get]] method of __O__ #this object# with argument ToString(k).
If Result(12) is undefined or null, use the empty string; otherwise, call ToString(Result(12)). __If the call to ToString would cause a nonterminating recursion use the empty string as the result of this step.__
Let R be a string value produced by concatenating S and Result(13).
Increase k by 1.
Go to step 10.
The length property of the join method is 1.
The join function is intentionally generic; it does not require that its this value be an Array object. Therefore, it can be transferred to other kinds of objects for use as a method. Whether the join function can be applied successfully to a host object is implementation-dependent. __JScript 5.x does not allow the join function to be applied to a host object.__