I have requirement like if the given string contains vowels it should print the founded vowels , if it does not contain vowels it should print message like no vowels found.
function findVowels(str) {
const vowels = ['a', 'e', 'i', 'o', 'u'];
const foundVowels = str.contains(vowels);
if (foundVowels.length > 0) {
console.log('Found vowels:', foundVowels.join(', '));
} else {
console.log('No vowels found.');
}
}
const inputString = "Hello, World!";
findVowels(inputString);