You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lettemplate=`Sometimes ${wordList[0]} it ${wordList[1]} is ${wordList[2]} better ${wordList[3]} to ${wordList[4]} just ${wordList[5]} walk ${wordList[6]} away ${wordList[7]} from ${wordList[8]} things ${wordList[9]} and ${wordList[10]} go ${wordList[11]} back ${wordList[12]} to ${wordList[13]} them ${wordList[4]} later ${wordList[5]} when ${wordList[16]} you’re ${wordList[17]} in ${wordList[18]} a ${wordList[19]} better ${wordList[20]} frame ${wordList[21]} of ${wordList[22]} mind.`;
50
+
}
51
+
52
+
functionsingleQuotesWithStringBuildup(wordList){
53
+
lettemplate='Sometimes '+wordList[0]+' it '+wordList[1]+' is '+wordList[2]+' better '+wordList[3]+' to '+wordList[4]+' just '+wordList[5]+' walk '+wordList[6]+' away '+wordList[7]+' from '+wordList[8]+' things '+wordList[9]+' and '+wordList[10]+' go '+wordList[11]+' back '+wordList[12]+' to '+wordList[13]+' them '+wordList[14]+' later '+wordList[15]+' when '+wordList[16]+' you’re '+wordList[17]+' in '+wordList[18]+' a '+wordList[19]+' better '+wordList[20]+' frame '+wordList[21]+' of '+wordList[22]+' mind.';
54
+
}
55
+
56
+
functionreplaceMultipleTimes(wordList){
57
+
// Could use: [str0], [str1], [str2] etc, however how to you increment without using '[str'+i+']' and skew the results?
58
+
lettemplate='Sometimes [str] it [str] is [str] better [str] to [str] just [str] walk [str] away [str] from [str] things [str] and [str] go [str] back [str] to [str] them [str] later [str] when [str] you’re [str] in [str] a [str] better [str] frame [str] of [str] mind.';
59
+
for(leti=0;i<24;i++){
60
+
// Only use replace here, as we want to replace the first one, and then replace the next one on the next loop with the next word.
0 commit comments