Closed RazvanBugoi closed 4 years ago
String.prototype.vowel = function() {
let vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];
return (/^[aeiouAEIOU]$/g).test(this);
};
String.prototype.vowel = function() {
let vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];
return this.length == 1 ? (/^[aeiouAEIOU]$/g).test(this) : false;
};
https://www.codewars.com/kata/567bed99ee3451292c000025/train/javascript