pushOntoArray function

JS task pushOntoArray completed and commented.