each methods for the browser and node.js