- the empty string is a palindrome;
- a string constituted only by a single character is a palindrome;
- a string c s d is a palindrome, if s is a palindrome and c is a character equal to d;
- nothing else is a palindrome.
Run unit tests via
npm run tests
- directly in VSCode with 'F5'
Read about Red, Green, Refactor TDD pattern.
Explore Jest matchers (.ToBe()
is a matcher, there are many matchers).
Add a debugger;
line to cause the debugger to break. You may then step through the code with F5 (Continue), F10 (Step Over), and F11 (Step Out). Learn more Debugging in VSCode.
Advanced study: Turning recursion into iterative functions