diff --git a/js/utils.js b/js/utils.js index e45721490288165b820c58291549ae931be3ff3f..2026efe2e9c794e6c0fb3abed122be3709f2735c 100644 --- a/js/utils.js +++ b/js/utils.js @@ -411,31 +411,3 @@ function median(arr = []) { (nums[mid] + nums[mid - 1]) / 2 : nums[mid]; } - -/** - * Returns whether a letter is a vowel. - * @param {string} char Can use any case - * @returns {boolean} - */ -function isVowel(char) { - return /[aeiou]/.test(char); -} - -/** - * Returns whether a string begins with a vowel. - * @param {string} word Can use any case - * @returns {boolean} - */ -function startsWithVowel(word) { - return isVowel(word.charAt(0).toLowerCase()); -} - -/** - * @example const a = aOrAn("apple"); - * - * `She is eating ${a} apple.` // "She is eating an apple." - * @param {string} word - */ -function aOrAn(word) { - return startsWithVowel(word) ? 'an' : 'a'; -}