 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Determining a pangram string in JavaScript
Pangram strings:
A pangram is a string that contains every letter of the English alphabet.
We are required to write a JavaScript function that takes in a string as the first and the only argument and determines whether that string is a pangram or not. For the purpose of this problem, we will take only lowercase alphabets into consideration.
Example
The code for this will be −
const str = 'We promptly judged antique ivory buckles for the next prize'; const isPangram = (str = '') => {    str = str.toLowerCase();    const { length } = str;    const alphabets = 'abcdefghijklmnopqrstuvwxyz';    const alphaArr = alphabets.split('');    for(let i = 0; i < length; i++){       const el = str[i];       const index = alphaArr.indexOf(el);       if(index !== -1){          alphaArr.splice(index, 1);       };    };    return !alphaArr.length; }; console.log(isPangram(str)); Output
And the output in the console will be −
true
Advertisements
 