// write code here
const letters = ['a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
let result = '';
for (let i=0; i<arr.length-1; i++){
if (letters.indexOf(arr[i].toLowerCase()) >= 0 && letters.indexOf(arr[i+1].toLowerCase())
>= 0){
result += arr[i] + '-'
}else{
result += arr[i]
}
}
result += arr[arr.length-1]
return result
}
/**
* Test Suite
*/
describe('insertDashes()', () => {
it('insert dashes in between chars', () => {
// arrange
const value = "aba caba";
// act
const result = insertDashes(value);
// log
console.log("result: ", result);
// assert
expect(result).toBe("a-b-a c-a-b-a");
});
});
function insertDashes(arr) {