const letterVariations = [
[' ','0','1','2','3','4','5','6','7','8','9'],
['A','a','B','b','C','c','D','d','E','e',';'],
['Â','â','F','f','G','g','H','h','Ê','ê',':'],
['À','à','I','i','J','j','K','k','È','è','.'],
['L','l','Î','î','M','m','N','n','É','é','?'],
['O','o','Ï','ï','P','p','Q','q','R','r','!'],
['Ô','ô','S','s','T','t','U','u','V','v','“'],
['W','w','X','x','Y','y','Ù','ù','Z','z','”'],
['@','&','#','[','(','/',')',']','+','=','-'],
];
function getIndexOfLetter(letter) {
return letterVariations.reduce((result, values, index) => {
if (result[0] > -1) return result;
const found = values.indexOf(letter);
return found > -1 ? [Number(index), found] : result;
}, [-1, -1])
}
console.log(getIndexOfLetter('k'))