This is the method Google themselves use in at least one sample:
var markers = [];
// Clear out the old markers.
markers.forEach(function(marker) {
marker.setMap(null);
});
markers = [];
Check Google sample for complete code example:
https://developers.google.com/maps/documentation/javascript/examples/places-searchbox