Solución
solution.tsTypeScript
function* nextLetter(word: string) {
for(let letter of word) {
yield letter;
}
}
export function intercalateChars(first: string, second: string) {
const it1 = nextLetter(first);
const it2 = nextLetter(second);
let output = ''
while(true) {
const { value: v1, done: d1 } = it1.next();
const { value: v2, done: d2 } = it2.next();
if( d1 && d2) break;
if ( !d1 ) output += v1;
if ( !d2 ) output += v2;
}
return output;
}0respuestas