Permalink
Browse files

Compact $.fn.each a bit

It's a bit simpler now, as per this suggestion by @staabm:
madrobby#632 (comment)
  • Loading branch information...
1 parent 4d69f67 commit 7aeb12bd61721253425d6979e4b2cedd75287441 @mitio committed Nov 5, 2012
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/zepto.js
View
5 src/zepto.js
@@ -350,10 +350,7 @@ var Zepto = (function() {
})
},
each: function(callback){
- emptyArray.every.call(this, function(el, idx){
- if (callback.call(el, idx, el) === false) return false
- else return true
- })
+ emptyArray.every.call(this, function(el, idx){ return callback.call(el, idx, el) !== false })
return this
},
filter: function(selector){

0 comments on commit 7aeb12b

Please sign in to comment.