Solution for Pangram

pull/2/head
Raphael 2019-09-22 19:30:57 +02:00 committed by GitHub
parent d3fa4fa011
commit 45cfcb8c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,9 @@
function isPangram(string) {
const alph = 'abcdefghijklmnopqrstuvwxyz';
const str = string.toLowerCase();
return alph.split('').every(e => str.indexOf(e) !== -1);
}
Test.assertEquals(isPangram('The quick brown fox jumps over the lazy dog.'), true);
Test.assertEquals(isPangram('This is not a pangram.'), false);