Looking at below piece of code
var _Array = window.frames[window.frames.length-1].Array;
Something like this might become more-clear if we break it down a bit.
// Get the global window object for the last frame on the page. var iframeWindow = window.frames[window.frames.length-1]; // Get the Array constructor for the iframe window. var _Array = iframeWindow.Array;
window.frames is an array-like object, which contains all the frames in the window. Once you have a reference to one of them, you can access the frames global variables as properties of that object, just like you can access the globals for the current window through the
window object. In this case, the frames global
Array constructor is being accessed.
The equivalent code for getting the
Array constructor for the current window would be:
var _Array = window.Array;