Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
audinue committed Jun 3, 2016
0 parents commit d63489b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "utility-js",
"version": "0.1.0",
"description": "Utility functions.",
"main": "utility.js",
"author": "Audi Nugraha <[email protected]>",
"license": "MIT"
}
9 changes: 9 additions & 0 deletions utility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

exports.forEach = function(array, callback) {
for(var i = 0, length = array.length; i < length; i++) {
if(callback(array[i], i, array) === false) {
break;
}
}
return array;
};

0 comments on commit d63489b

Please sign in to comment.