I am trying to split up substring charaters from a string from what i have tryed so far has failed even looping within a loop.
An example result from string “1234567890” the output could look like as follows
12
345
6
7890
.
var randomChar = ""
var str = "123456789";
for (var j = 0; j < str.length; j++) {
randomChar = Math.floor(Math.random() * 3) + 1;
console.log(str.substr(j, randomChar));
}
here you go:
or alternatively:
or alternatively: