DEV Community

Discussion on: Why Facebook's api starts with a for loop

Collapse
 
antogarand profile image
Antony Garand

In your webpage, you would do the following:

<script>
function Array(){
    alert('You created an array!');
}
</script>
<script src="https://gmail.com/messages"></script>

This way you overload the constructor before loading the messages themselves.

Collapse
 
raphipsp profile image
raphipsp

Ah ok, I see.
I think the way it is written in the article is confusing. It should instead say "override the Array constructor before loading external scripts"

Thread Thread
 
antogarand profile image
Antony Garand

Thanks for the feedback, updated the post so it's more clear

Thread Thread
 
raphipsp profile image
raphipsp

Wow you're fast!