8000 Fixed incomplete sentence :P · AllAlgorithms/javascript@da0f3d5 · GitHub
[go: up one dir, main page]

Skip to content

Commit da0f3d5

Browse files
authored
Fixed incomplete sentence :P
1 parent fcb8736 commit da0f3d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/anagram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//Check if 2 words are anagrams of each other.
22
var o1 = "arms";
33
var o2 = "mars"
4-
//Remove
4+
//Remove non-letter characters, and sort the letters in alphabetical order.
55
var n1 = o1.replace(/\W+/g,'').toLowerCase().split("").sort().join("");
66
var n2 = o2.replace(/\W+/g,'').toLowerCase().split("").sort().join("");
77
var isAnagram = n1==n2;

0 commit comments

Comments
 (0)
0