Skip to content

Commit

Permalink
shorter version of flatten(array)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekhaled committed Mar 5, 2011
1 parent 24019c0 commit 82fd6b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zepto.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var Zepto = (function() {

function classRE(name){ return new RegExp("(^|\\s)" + name + "(\\s|$)") }
function compact(array){ return array.filter(function(item){ return item !== undefined && item !== null }) }
function flatten(array){ return array.reduce(function(a,b){ return a.concat(b) }, []) }
function flatten(array){ return [].concat.apply([], array); }
function camelize(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
function uniq(array){
var r = [];
Expand Down

0 comments on commit 82fd6b0

Please sign in to comment.