Travis build: 1705 [cron]
This commit is contained in:
@ -1,5 +1,11 @@
|
||||
const isAnagram = (str1, str2) => {
|
||||
const normalize = str => str.toLowerCase().replace(/[^a-z0-9]/gi, '').split('').sort().join('');
|
||||
const normalize = str =>
|
||||
str
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]/gi, '')
|
||||
.split('')
|
||||
.sort()
|
||||
.join('');
|
||||
return normalize(str1) === normalize(str2);
|
||||
};
|
||||
module.exports = isAnagram;
|
||||
module.exports = isAnagram;
|
||||
Reference in New Issue
Block a user