2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,12 +1,11 @@
function is_pangram(str) {
var s = str.toLowerCase();
function isPangram(s) {
var letters = "zqxjkvbpygfwmucldrhsnioate"
// sorted by frequency ascending (http://en.wikipedia.org/wiki/Letter_frequency)
var letters = "zqxjkvbpygfwmucldrhsnioate";
s = s.toLowerCase().replace(/[^a-z]/g,'')
for (var i = 0; i < 26; i++)
if (s.indexOf(letters.charAt(i)) == -1)
return false;
return true;
if (s.indexOf(letters[i]) < 0) return false
return true
}
print(is_pangram("is this a pangram")); // false
print(is_pangram("The quick brown fox jumps over the lazy dog")); // true
console.log(isPangram("is this a pangram")) // false
console.log(isPangram("The quick brown fox jumps over the lazy dog")) // true