## DEV Community is a community of 642,931 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

# Discussion on: Unconditional Challenge: FizzBuzz without `if`

## Replies for: Happy Juneteenth! I love everyone's approaches here, it's fun to see the way each person thinks through the problem. I'll be posting my answers on...

Nathan Kallman • Edited

As promised, here is my functional approach to solving this (deeper article on it to come soon)

``````const functionalTrue = (onTrue, onFalse) => onTrue;
const functionalFalse = (onTrue, onFalse) => onFalse;
const isDivisible = (dividend, divisor) => [functionalTrue, ...Array(divisor).fill(functionalFalse)][dividend % divisor];

const functionalFizzBuzz = (n) => {
const divisible_by_three = isDivisible(n, 3);
const divisible_by_five = isDivisible(n, 5);
return divisible_by_three(divisible_by_five("FizzBuzz", "Fizz"), divisible_by_five("Buzz", n));
};
``````

Similar to Heiker's solution above; the main part of this solution is defining "true" and "false" as functions taking the same two parameters but returning one or the other.