// Write a function definition named isVowel that takes in value and returns true if the value is a, e, i, o, u in upper or lower case.
I’ve tried a few different versions of code that supposed to work but The problem still does not return solved. thoughts?
const isVowel = (s: string) => !!s.match(/[aeiou]/ig)
const iVowel = (s: string) => /^[aeiou]$/gi.test(s)
In js it would be this:
const iVowel = s => /^[aeiouy]+$/gi.test(s)
Okay, so I can make that code work. now my question is why does it work that way? would I use the same syntactical sugar if I wanted to change the rule to //return true if string has a vowel?