<script type="text/javascript">var aa =[["a",3],["b",4],["c",2],["d",1]];alert(aa.sort(function(x,y){return x[1]-y[1]}))</script>