Skip to content

Instantly share code, notes, and snippets.

View saloni-jain484's full-sized avatar
🏠
Working from home

Saloni Jain saloni-jain484

🏠
Working from home
  • @tata Consultancy Services
  • Greater Noida
View GitHub Profile
@saloni-jain484
saloni-jain484 / Day -2 JavaScript Practice
Last active May 11, 2024 11:58
Hacker Rank - 10 Days of JavaScript Practice
Task
Complete the vowelsAndConsonants function in the editor below. It has one parameter, a string, , consisting of lowercase English alphabetic letters (i.e., a through z). The function must do the following:
First, print each vowel in on a new line. The English vowels are a, e, i, o, and u, and each vowel must be printed in the same order as it appeared in .
Second, print each consonant (i.e., non-vowel) in on a new line in the same order as it appeared in string.
Solution
function vowelsAndConsonants(s) {