Factorial
by Sam Fereday
HTML
<button id="go">
Go
</button>
JavaScript 1.7
const pickTenLargest = (stream, length) => {
return stream
.sort((a, b) => b - a)
.filter((n, i) => i < length);
}
const stream = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const result = pickTenLargest(stream, 10);
console.log(result);