DEV Community

loading...

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

Collapse
raphipsp profile image
raphipsp

Replace var x with an html script tag?
But how?

Collapse
antogarand profile image
Antony Garand Author

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 Author

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

Thread Thread
raphipsp profile image
raphipsp

Wow you're fast!