diff --git a/javascript/Pangram/solution.js b/javascript/Pangram/solution.js new file mode 100644 index 0000000..2b8bb06 --- /dev/null +++ b/javascript/Pangram/solution.js @@ -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);