Write a function that takes a string as input and reverse only the vowels of a string.

    Example 1:

    1. Input: "hello"
    2. Output: "holle"

    Example 2:

    Input: "leetcode"
    Output: "leotcede"
    

    Note:
    The vowels does not include the letter “y”.

    /**
     * @param {string} s
     * @return {string}
     */
    var reverseVowels = function(s) {
        const vowelMap = {
            'a': true,
            'e': true,
            'i': true,
            'o': true,
            'u': true,
            'A': true,
            'E': true,
            'I': true,
            'O': true,
            'U': true,
        };
        let tmp;
        let i = 0;
        let j = s.length - 1;
        s = s.split('');
        while (j > i) {
            if (vowelMap[s[i]] && vowelMap[s[j]]) {
                tmp = s[i];
                s[i] = s[j];
                s[j] = tmp;
                i++;
                j--;
            } else {
                if (!vowelMap[s[i]]) {
                    i++;
                }
                if (!vowelMap[s[j]]) {
                    j--;
                }
            }
        }
        return s.join('');
    };