Even if this question has accepted answer about a right way of using Array.isArray()
Question was about executing particular code from W3Schools, so for educational reasons there is what is happening in code example.
myArray.constructor is reference to object constructor. More at Link
With that in mind, we can proceed to:
myArray.constructor.toString()
Will result into
function Array() {
[native code] }
Function indexOf will return position of string sequence in other string sequence. If string we are looking for is found it will return int position. If not indexOf will return -1.
Function could be described as If position of "Array" in stringified contructor of object is greater then -1, object is array.
Hope this helps.