Take me down to the paradise city where the grass is green and the girls are pretty!
JavaScript has a built in push() function which allows a coder to add more arrays to an existing array. So lets say we have an array like so:
<script type="text/javascript">
//push() explanation
var Set = [];
Set[0] = ["Wow"]
Set[1] = ["this"]
Set[2] = ["is"]
document.write(Set);
</script>
Now anyone who knows how an array works would know that this would write out
Wow,this,isOk, now for the function push() this method is very simple to understand and you can pass this function MANY parameters. The function is set-up like this:
<script type="text/javascript">
//push() explanation
var Set = [];
Set[0] = ["Wow"]
Set[1] = ["this"]
Set[2] = ["is"]
Set.push("crazy");
document.write(Set);
</script>
Now you see that we've basically
appended the word "crazy" to the existing array. Which now the array would output like so:
Wow,this,is,crazy
That's all the push() method is about, nothing extreme, but quite useful.
