Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

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); } );
Comment

check the string is vowel or not javascript

// check the word is vowel or not
let words = "aeiou";

let newWords = "";

function isVowelOrNot(words) {
   for (let word of words) {
      if (
         word === "a" ||
         word === "e" ||
         word === "i" ||
         word === "o" ||
         word === "u"
      ) {
         newWords = newWords + word;
      }
   }
   if (newWords === words) {
      return true;
   } else {
      return false;
   }
}

let result = isVowelOrNot(words);
console.log(result);
Comment

how to make a vowel counter in javascript

const vowelCount = str => {
  let vowels = /[aeiou]/gi;
  let result = str.match(vowels);
  let count = result.length;

  console.log(count);
};
Comment

how to make a vowel counter in javascript

function countVowels(str) {
  return str.match(/[aeiou]/g).length;
}
Comment

find vowels in string javascript

// Finding the number of vowels in a string.
// Bir string-dizideki sesli harflerin sayısını bulma.

var str = "Küçük-BÜYÜK sesli harflerden OLUŞAN bir STRİNG cümlesi"; 
var counter = 0;          
  str.split("").forEach(element => {      
    var sesliHarfler = ["A", "E", "I", "İ", "O", "Ö", "U", "Ü", "a", "e", "ı", "i", "o", "ö", "u", "ü"];
      var str_1 = (sesliHarfler.includes(element)); 
        if (str_1 == true) {
          counter++;
           console.log(counter);
   };                                           
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jspdf line 
Javascript :: jquery delete prev sibling 
Javascript :: input pattern for no whitespaces at the end or beginning 
Javascript :: iterate over array backwards javascript 
Javascript :: get width of a dom element js 
Javascript :: stop a setinterval 
Javascript :: clear input field data on button click 
Javascript :: jquery selected label option 
Javascript :: create hash password in js 
Javascript :: make string json object vue 
Javascript :: query injection nestjs 
Javascript :: discord.js role regex 
Javascript :: p5js class 
Javascript :: Error: EACCES: permission denied, 
Javascript :: how to get dynamically generated id in javascript 
Javascript :: jquery add html to end of div 
Javascript :: gettype js 
Javascript :: how to flatten array with reduce in javascript 
Javascript :: javascript play sound on click 
Javascript :: moment date difference in days 
Javascript :: faker npm 
Javascript :: jquery destroy element 
Javascript :: loop through object element names javascript 
Javascript :: index.js vs main.js 
Javascript :: create parent div javascript 
Javascript :: csrf token ajax header 
Javascript :: datetimepicker set value 
Javascript :: npx: Create react chrome extension 
Javascript :: jquery append after 
Javascript :: express messages 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =