Skip to content
Snippets Groups Projects
Commit a90c7163 authored by brickode's avatar brickode
Browse files

Removed functions

parent d4d0d4d2
No related branches found
No related tags found
No related merge requests found
......@@ -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';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment