Permutations: Difference between revisions

Content added Content deleted
(→‎{{header|JavaScript}}: ES5 and ES6 functional versions updated (latter moved to correct heading))
Line 2,527: Line 2,527:


// permutations :: [a] -> [[a]]
// permutations :: [a] -> [[a]]

var permutations = function (xs) {
var permutations = function (xs) {
return xs.length ? concatMap(function (x) {
return xs.length ? concatMap(function (x) {