mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-17 13:43:23 +09:00
Order exercise folders
Ordered the exercise folders by placing their numbers in their folder name
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Exercise 09 - Palindromes
|
||||
|
||||
Write a function that determines whether or not a given string is a palindrome.
|
||||
|
||||
A palindrome is a string that is spelled the same both forwards and backwards, usually without considering punctuation or word breaks:
|
||||
|
||||
### some palindromes:
|
||||
- A car, a man, a maraca.
|
||||
- Rats live on no evil star.
|
||||
- Lid off a daffodil.
|
||||
- Animal loots foliated detail of stool lamina.
|
||||
- A nut for a jar of tuna.
|
||||
|
||||
```javascript
|
||||
palindromes('racecar') // true
|
||||
palindromes('tacos') // false
|
||||
```
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
const palindromes = function () {
|
||||
|
||||
};
|
||||
|
||||
module.exports = palindromes;
|
||||
@@ -0,0 +1,22 @@
|
||||
const palindromes = require('./palindromes')
|
||||
|
||||
describe('palindromes', () => {
|
||||
test('works with single words', () => {
|
||||
expect(palindromes('racecar')).toBe(true);
|
||||
});
|
||||
test.skip('works with punctuation ', () => {
|
||||
expect(palindromes('racecar!')).toBe(true);
|
||||
});
|
||||
test.skip('works with upper-case letters ', () => {
|
||||
expect(palindromes('Racecar!')).toBe(true);
|
||||
});
|
||||
test.skip('works with multiple words', () => {
|
||||
expect(palindromes('A car, a man, a maraca.')).toBe(true);
|
||||
});
|
||||
test.skip('works with multiple words', () => {
|
||||
expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(true);
|
||||
});
|
||||
test.skip('doesn\'t just always return true', () => {
|
||||
expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user