- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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
- Related Articles
- Determining beautiful number string in JavaScript
- Determining rightness of a triangle – JavaScript
- Java program to check if string is pangram
- Determining isomorphic strings JavaScript
- Determining full house in poker - JavaScript
- Python program to check if the string is pangram
- Program to check given string is pangram or not in Python
- Python program to check if the given string is pangram
- Java Program to Check Whether the Given String is Pangram
- Determining happy numbers using recursion JavaScript
- Determining whether numbers form additive sequence in JavaScript
- Determining rank on basis of marks in JavaScript
- Using Set() in Python Pangram Checking
- Determining sum of array as even or odd in JavaScript
- Interchanging a string to a binary string in JavaScript

Advertisements