using Array.prototype.reverse for reversing arrays.