-8

How would I make a timer to print the word Loading? By one letter every second?

example: L then another second and then o then another second and then a..

ETC

Xtacy Xtatic
  • 41
  • 1
  • 2
  • 7

1 Answers1

1

Try this:

var msg="Loading";
var index=0;
setInterval(function(){ index++;console.log(msg.substring(0,index)) },1000);
alasarr
  • 1,565
  • 3
  • 16
  • 32