What you need is something like this:
var arrPos = [[37.772323, -122.214897], [21.291982, -157.821856], [-18.142599, 178.431], etc. ]; var flightPlanCoordinates = [];var temp;for(var i = 0; i < arrPos.length; i++) { flightPathCoordinates.push( new google.maps.LatLng(arrPos[i][0], arrPos[i][1]);}
The push() method adds an element to the end of an array.