My first guess is that perhaps the array variable has been initialized/given a the wrong type. for example:
var array = " ";
This would give the error you are mentioning because the array variable has been initialized as a string by the =" "; after the variable. And strings do not have the push() method available to them. This following code would work:
var array = [ ];
As a quick helper tip, it is helpful if you post the code snippet that you are having trouble with.
Hope this helps!