Welcome to No Let!
What is No Let?
No Let is a series of JavaScript puzzles where you have to use pure
functional programming, which means that you aren't allowed to use let or anything else with mutable state.
To complete each puzzle, your code will need to pass two tests:
- A linter that analyzes your code and checks if you're using mutable
state. If you try to declare a variable using
let, the linter will flag it and you will fail the test. - A logic test that ensures that your code outputs the correct answer.
What is pure functional programming?
Pure functional programming is a programming paradigm where you aren't allowed to use mutable state. This
means that you can't reassign variables, which means that you can't increment
counters, which means that it's impossible to use for loops. For the same reasons, you're unable to use while loops,
and a few other things.
These extremely restrictive self-imposed limitations force you to do things the functional programming way, which involves lambda calculus, recursive functions, currying, etc.
Instructions
Each puzzle gives you some code to start with. The starter code will pass the logic test correctly, but it will fail the linting. Your job is to tweak the code to make it pass the linter without making it fail the logic test.
Open the first puzzle by clicking the link below "Next" in the bottom right corner.