Minimum numbers of three lists: Difference between revisions

(→‎{{header|JavaScript}}: Added a JavaScript version.)
Line 207:
 
// --------------------- GENERIC ---------------------
 
// min :: Ord a => (a, a) -> a
const min = (a, b) =>
// The lesser of a and b.
b < a ? )b : a,;
 
 
// minimum :: Ord a => [a] -> a
Line 212 ⟶ 218:
// The least value of xs.
0 < xs.length ? (
xs.slice(1).reduce(min, xs[0])
.reduce((a, x) => x < a ? (
x
) : a,
xs[0]
)
) : null;
 
Line 234 ⟶ 235:
 
// MAIN ---
return JSON.stringify(main());
})();</lang>
{{Out}}
9,655

edits