JSFiddle - React, Tailwind, and code Playground
by Scott Kaye
HTML
Reverse only the vowels in a string (code golf)
JavaScript
const swapVowels=(_,a=_.split``,v=c=>-~"aeiou".indexOf(c),s=[])=>eval('for(i=0,j=~-a.length;i<j;v(a[i])&&(s[0]=i),v(a[j])&&(s[1]=j),!isNaN(s[0]+s[1])&&([a[s[1]],a[s[0]]]=[a[s[0]],a[s[1]]],s=[]),++i,--j);a.join``')
console.assert(swapVowels("hello") === "holle");
console.log(swapVowels("hello"))