File tree 3 files changed +45
-0
lines changed 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Exercise XX - palindromes
2
+
3
+ Write a function that determines whether or not a given string is a palindrome.
4
+
5
+ A palindrome is a string that is spelled the same both forwards and backwards, usually without considering punctuation or word breaks:
6
+
7
+ ### some palindromes:
8
+ - A car, a man, a maraca.
9
+ - Rats live on no evil star.
10
+ - Lid off a daffodil.
11
+ - Animal loots foliated detail of stool lamina.
12
+ - A nut for a jar of tuna.
13
+ - A car, a man, a maraca.
14
+
15
+ ``` javascript
16
+ palindromes (' racecar' ) // true
17
+ palindromes (' tacos' ) // false
18
+ ```
19
+
20
+
Original file line number Diff line number Diff line change
1
+ var palindromes = function ( ) {
2
+
3
+ }
4
+
5
+ module . exports = palindromes
Original file line number Diff line number Diff line change
1
+ var palindromes = require ( './palindromes' )
2
+
3
+ describe ( 'palindromes' , function ( ) {
4
+ it ( 'works with single words' , function ( ) {
5
+ expect ( palindromes ( 'racecar' ) ) . toEqual ( true ) ;
6
+ } ) ;
7
+ xit ( 'works with punctuation' , function ( ) {
8
+ expect ( palindromes ( 'Racecar!' ) ) . toEqual ( true ) ;
9
+ } ) ;
10
+ xit ( 'works with multiple words' , function ( ) {
11
+ expect ( palindromes ( 'A car, a man, a maraca.' ) ) . toEqual ( true ) ;
12
+ } ) ;
13
+ xit ( 'works with multiple words' , function ( ) {
14
+ expect ( palindromes ( 'Animal loots foliated detail of stool lamina.' ) ) . toEqual ( true ) ;
15
+ } ) ;
16
+ xit ( 'doesn\'t just always return true' , function ( ) {
17
+ expect ( palindromes ( 'ZZZZ car, a man, a maraca.' ) ) . toEqual ( false ) ;
18
+ } ) ;
19
+
20
+ } ) ;
You can’t perform that action at this time.
0 commit comments