Slice() Kullanımı
Örnek
<script>
let i=0, KarakterSayisi=3;
let text = "ElmaArmutŞeftaliMuz";
//let part = text.slice(7, 10);
//alert(text.length);
//alert(parseInt((Math.random() * text.length)));
while (i <100){
let Kelimecik;
//document.write(parseInt((Math.random() * text.length)));
setTimeout(function(){
RastGeleSayi = parseInt((Math.random() * text.length - (KarakterSayisi-1)));
let Kelimecik=text.slice(RastGeleSayi, RastGeleSayi+KarakterSayisi) ;
document.write(Kelimecik.toUpperCase() + " ");
}, 10 * i);
i++;
}
</script>
let i=0, KarakterSayisi=3;
let text = "ElmaArmutŞeftaliMuz";
//let part = text.slice(7, 10);
//alert(text.length);
//alert(parseInt((Math.random() * text.length)));
while (i <100){
let Kelimecik;
//document.write(parseInt((Math.random() * text.length)));
setTimeout(function(){
RastGeleSayi = parseInt((Math.random() * text.length - (KarakterSayisi-1)));
let Kelimecik=text.slice(RastGeleSayi, RastGeleSayi+KarakterSayisi) ;
document.write(Kelimecik.toUpperCase() + " ");
}, 10 * i);
i++;
}
</script>