function fn(){ var tags = new Array(); tags = [].slice.call(arguments); tags.sort(function(a,b){ return a-b; }) return tags; }