General FizzBuzz: Difference between revisions
→JS ES6: Got it – so the other fold is better understood as a map, with intercalated '\n'. Simplified here.
(→JS ES6: Got it – so the other fold is better understood as a map, with intercalated '\n'. Simplified here.) |
|||
Line 1,340:
'use strict';
//
const
Array.from({
length:
}, (_, i) =>
const defaultRules = Object.freeze([
Line 1,354 ⟶ 1,355:
// fizzBuzz :: Int -> [[Int, String]] -> String
const fizzBuzz = (max, rules = defaultRules) =>
) ||
console.log(fizzBuzz(20));
|