I am a software development engineer in test for Infosys. My job is officially to write automated tests in Selenium Webdriver. I'm also a web developer as a hobbyest
functioncountVowels(string){constvowels='aeiouAEIOU';returnstring.split('').reduce((counter,current)=>{if(vowels.indexOf(current)!=-1){if(counter[current]){counter[current]+=1;}else{counter[current]=1;}}returncounter;},{});}console.log(countVowels('How much wood would a woodchuck chuck if a woodchuck could chuck wood?'));// { o: 11, u: 7, a: 2, i: 1 }
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
JavaScript, using reduce: