挿入ソートを再帰で実装してみる - Qiita

前回のやつの再帰バージョン。function insert(x, xs) { if(xs.length <= 0) { return [x]; } var y = xs.shift(); if (…