Skip to content

Commit 134b0d4

Browse files
committed
Isograms challenge.
1 parent d53ee2e commit 134b0d4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Isograms.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Check to see if a string has repeating letters.
3+
*/
4+
function isIsogram(str) {
5+
var i, j;
6+
str = str.toLowerCase();
7+
for(i = 0; i < str.length; ++i)
8+
for(j = i + 1; j < str.length; ++j)
9+
if(str[i] === str[j])
10+
return false;
11+
return true;
12+
}
13+
14+
console.log(isIsogram("Here I am."))

0 commit comments

Comments
 (0)