Jump to content

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 (ES 5)ES6===
====Functional====
 
<lang JavaScript>//(() isPangram :: String -=> Bool{
'use strict';
function isPangram(s) {
var lc = s.toLowerCase();
 
// isPangram :: String -> Bool
return 'abcdefghijklmnopqrstuvwxyz'
let isPangram = s .split('')=> {
let lc = s.filtertoLowerCase(function (c) {;
return lc.indexOf(c) === -1;
})
.length === 0;
}
 
return 'abcdefghijklmnopqrstuvwxyz'
[
'is this a pangram .split('',)
return.filter(c => lc.indexOf(c) === -1;)
'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'
].map(isPangram);</lang>
 
})();</lang>
 
{{Out}}
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.