#Experiment 3: Can I solve FizzBuzz using ONLY JS functions, and ABSOLUTELY nothing else

Jigar Gosar
The Functional Programmer
1 min readOct 25, 2016

--

Yup! you heard it right. No variables, operators, numbers, booleans, objects, control structures. Absolutely nothing but but plain old javascript functions.

Using No Other Language Feature But Functions

The Not So Impossible Target

It has been proved that it can be done. Somewhere around 1940’s some guy proposed using functions as basis for mathematics and computation, and this theory also ended up being Turing Complete.

But WHY!

I was inspired by the Ruby Version of this fun little experiment by Tom Stuart. And it seems like a fun exercise. And I have another hidden agenda :D

So, lets define todays target.

Define

  • Write a traditional solution to FizzBuzz in javascript.
  • Write a test.
  • Push to GitHub
  • Try to make small changes such that our test doesn’t break.
  • Try to Remove at least 2 language features by EOD.
  • Blog at EOD.

Phew!

Here we go, the entire FizzBuzz program just using functions. Also uploaded to GitHub.

--

--