Ad
  • Custom User Avatar

    The javascript interpreter here doesn't seem to recognize the '.includes()' string method. I've tested the same code in multiple browsers and it works fine. In the codewars window I get the error-message "Object does not have the includes method". Is this because Codewars uses an older JS interpreter?

    Here's the function which works in all my browsers:

    function isVowel(chr) {
    var uma = String.fromCharCode(228);
    var umA = String.fromCharCode(196);
    var umo = String.fromCharCode(246);
    var umO = String.fromCharCode(214);
    var umu = String.fromCharCode(252);
    var umU = String.fromCharCode(220);
    var vowels = "aeiouAEIOU" + uma + umA + umo + umO + umu + umU;
    var ch = "" + chr;
    return vowels.includes(ch);
    }