Here is a simple example:
var consonants = [
'b', 'c', 'd', 'f', 'g', 'h', 'j',
'k', 'l', 'm', 'n', 'p', 'q', 'r',
's', 't', 'v', 'w', 'x', 'z'
];
var translate = function(str) {
var result="";
for (var i = 0; i < str.length; i++) {
if (cosonants.indexOf(str[i]) === -1) {
result += str[i];
continue;
}
result += str[i] + 'o' + str[i];
}
return result;
};
solved Double Consonants on String