setInterval(function(){
if(i>str.length-1){
i=0;
document.getElementById('test').innerHTML='';
}
document.getElementById('test').innerHTML=document.getElementById('test').innerHTML+arr[i];
i++;
},200);
<b id="test"></b>