Last active
August 18, 2021 13:59
-
-
Save bnb/100a12bc948bd1dd1362 to your computer and use it in GitHub Desktop.
Looking for a way to loop back to names[0]. The if() is the only way I can think of, but I'm not sure how to actually implement it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var names = [ | |
"&!", | |
"bnb", | |
"bang", | |
"bitnb", | |
"bitandbang", | |
"Tierney Coren" | |
] | |
for(i = 0; i < names.length; i++){ | |
$('.title') | |
.typetype( | |
"I am " + names[i] ".", | |
{ | |
e: 0.04, // error rate. (use e=0 for perfect typing) | |
t: 100, // interval between keypresses | |
}) | |
.backspace( | |
names[i].length + 1, | |
{ | |
t: 100 // interval between keypresses | |
}); | |
if(names[i] === names.length) { | |
//What's the best way to reset the array to names[0]? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment