Pangram checker: Difference between revisions
→Functional (ES 6): Module format to avoid clashes with global namespace
m (→{{header|AppleScript}}: Updated primitives) |
(→Functional (ES 6): Module format to avoid clashes with global namespace) |
||
Line 1,323:
console.log(isPangram("The quick brown fox jumps over the lazy dog")) // true</lang>
===
====Functional====
<lang JavaScript>
'use strict';
// isPangram :: String -> Bool
return 'abcdefghijklmnopqrstuvwxyz'▼
let isPangram = s
let lc = s.
return lc.indexOf(c) === -1;▼
})▼
.length === 0;▼
▲ return 'abcdefghijklmnopqrstuvwxyz'
'The quick brown fox jumps over the lazy dog'▼
▲ .length === 0;
].map(isPangram);</lang>▼
return [
'is this a pangram',
▲ 'The quick brown fox jumps over the lazy dog'
})();</lang>
{{Out}}
|