Polyfills for .map(), .filter() and .reduce() in Javascript