Arrays
Data Types
Regular Expressions
Declarative Programming
Advanced Language Features
Programming Paradigms
Fundamentals
Strings
let isPangram =str=>'abcdefghijklmnopqrstuvwxyz' .split`` .every(v => ~str.toLowerCase().indexOf(v))
let isPangram =str=>'abcdefghijklmnopqrstuvwxyz'.split('')// create an array of alphabets.map(v=>str.replace(/\W/g,'')// map the array and check if the input contains all the letters in alphabet// map function should return [true] for every right character.toLowerCase().includes(v)).every(v=>v===true)// if the mapped array contains all true values, then the str is a pangram else not.- let isPangram =str=>'abcdefghijklmnopqrstuvwxyz'
- .split``
- .every(v => ~str.toLowerCase().indexOf(v))
// TODO: Add your tests here // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework. // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework) // are still available for now. // // For new tests, using [Chai](https://chaijs.com/) is recommended. // You can use it by requiring: // const assert = require("chai").assert; // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted. describe("Solution", function() { it("should passed all test", function() { Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft Jim'),true); Test.assertEquals(isPangram('Sphinx of black quartz, judge my vow'),true); Test.assertEquals(isPangram('Two driven jocks help fax my big quiz'),true); Test.assertEquals(isPangram(' Five quacking zephyrs jolt my wax bed'),true); //A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent Test.assertEquals(isPangram('A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent'),true); Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft '),false); // assert.strictEqual(1 + 1, 2); }); });
// TODO: Add your tests here// Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.// [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)// are still available for now.//// For new tests, using [Chai](https://chaijs.com/) is recommended.// You can use it by requiring:// const assert = require("chai").assert;// If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.describe("Solution", function() {it("should passed all test", function() {Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft Jim'),true);Test.assertEquals(isPangram('Sphinx of black quartz, judge my vow'),true);Test.assertEquals(isPangram('Two driven jocks help fax my big quiz'),true);Test.assertEquals(isPangram(' Five quacking zephyrs jolt my wax bed'),true);//A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponentTest.assertEquals(isPangram('A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent'),true);Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft '),false);// assert.strictEqual(1 + 1, 2);});});- // TODO: Add your tests here
- // Starting from Node 10.x, [Mocha](https://mochajs.org) is used instead of our custom test framework.
- // [Codewars' assertion methods](https://github.com/Codewars/codewars.com/wiki/Codewars-JavaScript-Test-Framework)
- // are still available for now.
- //
- // For new tests, using [Chai](https://chaijs.com/) is recommended.
- // You can use it by requiring:
- // const assert = require("chai").assert;
- // If the failure output for deep equality is truncated, `chai.config.truncateThreshold` can be adjusted.
- describe("Solution", function() {
- it("should passed all test", function() {
- Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft Jim'),true);
- Test.assertEquals(isPangram('Sphinx of black quartz, judge my vow'),true);
- Test.assertEquals(isPangram('Two driven jocks help fax my big quiz'),true);
- Test.assertEquals(isPangram(' Five quacking zephyrs jolt my wax bed'),true);
- //A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent
- Test.assertEquals(isPangram('A mad boxer shot a quick, gloved jab to the jaw of his dizzy opponent'),true);
- Test.assertEquals(isPangram('Quick zephyrs blow, vexing daft '),false);
- // assert.strictEqual(1 + 1, 2);
- });
- });