Skip to content

Instantly share code, notes, and snippets.

@danielrohers
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielrohers/9693338 to your computer and use it in GitHub Desktop.
Save danielrohers/9693338 to your computer and use it in GitHub Desktop.
function _forEach (array, callback) {
if (array) {
var length = array.length;
for (var i = 0; i < length; i++) {
callback(array[i]);
}
}
};
var links = document.querySelectorAll('a');
_forEach(links, function (element) {
console.log(element);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment