All tests pass
This commit is contained in:
		
							parent
							
								
									27afb52393
								
							
						
					
					
						commit
						07ced0fc05
					
				| 
						 | 
					@ -1,5 +1,5 @@
 | 
				
			||||||
const palindromes = function(word) {
 | 
					const palindromes = function(word) {
 | 
				
			||||||
	const wordArr = word.replace().toLowerCase().split('');
 | 
						const wordArr = word.replace(/\W/g, '').toLowerCase().split('');
 | 
				
			||||||
	const reversedArray = wordArr.reverse();
 | 
						const reversedArray = wordArr.reverse();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	newArray = [];
 | 
						newArray = [];
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ const palindromes = function(word) {
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return true ? newArray.join('') === word : false;
 | 
						return true ? newArray.join('') === word.replace(/\W/g, '').toLowerCase() : false;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module.exports = palindromes
 | 
					module.exports = palindromes
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue