Skip to content

Commit

Permalink
Merge pull request #11 from tassiviktor/master
Browse files Browse the repository at this point in the history
Update ki.extend.js
  • Loading branch information
james2doyle committed Mar 5, 2016
2 parents 1214786 + e0c45f8 commit 5db7a75
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ki.extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
(function() {

$.each = function(arr, callback) {
var i = 0, l = arr.length;
for(; i < l; ++i) {
callback.call(arr[i], i, arr[i]);
if(toString.call(arr) === '[object Array]'){
var i = 0, l = arr.length;
for(; i < l; ++i) {
callback.call(arr[i], i, arr[i]);
}
} else {
for (i in arr)
callback.call(arr[i], i, arr[i]);
}
return this;
return arr;
};
// map some classlist functions to the jQuery counterpart
var props = ['addClass', 'removeClass', 'toggleClass'],
Expand Down

0 comments on commit 5db7a75

Please sign in to comment.