https://en.wikipedia.org/wiki/Reverse_Polish_notation
The input for the function should be a space separated string.
1
2
+
4
*
5
+
3
-
= 14
However feel free to take it as far as you like.
You can watch me implement this at 12x speed: https://youtu.be/UL0jsN4uPow
If you'd like to do this kata yourself checkout the master branch
- Start a timer (3 minutes suggested but whatever you're comfortable with)
- Write exactly 1 test
- If the timer ends and the test is red then
git reset --hard
- If the test is green then
git commit -a -m "refactor {feature}"
- If the timer ends and the test is red then
- Restart timer
- Refactor
- If the timer ends and refactoring is not complete then
git reset --hard
- If the refactoring is complete before the timer ends
git commit -a -m "refactor {feature}"
- If the timer ends and refactoring is not complete then
- Goto 1
goto statements ftw
- Smallest steps - Create the most tests (must show forward progress of code between commits).
- ES6 - Use the most ES6 features.
Install dependencies
npm install
Run tests
npm test
The test framework is Mocha and the assertion library is Should feel free to set something else up if you're more comfortable with it, this has just been provided for your convenience.