vowels Count js
function getCount(str) {
return (str.match(/[aeiou]/ig)||[]).length;
}
vowels Count js
function getCount(str) {
return (str.match(/[aeiou]/ig)||[]).length;
}
find vowel & consonants in a string java script
const str = "The quick brown fox jumps over a lazy dog";
const vowels = str.match(/[aeiou]/gi);
const consonants = str.match(/[^aeiou]/gi);
vowels.concat([''],consonants).forEach(k => { console.log(k); } );
vowels consonants javascript
//Ask to the user to type a letter
function readLetter() {
return prompt("Type a letter: ");
}
//Defines true if is a vowel(uppercase or lowercase);
function isVowel(character) {
switch (character) {
case "a":
case "A":
case "e":
case "E":
case "i":
case "I":
case "o":
case "O":
case "u":
case "U":
return true;
default:
return false;
}
}
// Brings a dependent message if previous result is true or false.
var letter = readLetter();
if (isVowel(letter)) alert("The letter is a vowel.");
else alert("The letter is consonant.");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us