Skip to content

Instantly share code, notes, and snippets.

@jikeytang
Last active August 29, 2015 14:01
Show Gist options
  • Save jikeytang/d27ffe12b90c4904eb88 to your computer and use it in GitHub Desktop.
Save jikeytang/d27ffe12b90c4904eb88 to your computer and use it in GitHub Desktop.
[ Javascript ] - 20140519-题目2
输入三个整数x,y,z,请把这三个数由小到大输出。
回答时注意加上下面这句话,才会有语法高亮或格式缩进。
```javascript
@jiangtao
Copy link

jiangtao commented Jun 4, 2014

豪情哥的答案好像按照asc码排列的

function sortNum(){
        var args = arguments;
        return Array.prototype.sort.call(arguments, function(a, b){
            return a - b;
        });
    }
sortNum(11,21,31);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment