js: older versions of Safari do not accept array-like objects for apply