I am trying to call a function and for it to return a new string each time it is called. If it is called and all strings have been called it then loops back to the start.
Pseudo Code:
function getString(){
var array = ['1','2','3','4'];
// JS Magic??
return finalVal;
}
Expected Magic:
getSting();
1
getSting();
2
getSting();
3
getSting();
4
getSting();
1
getSting();
2
You get the idea I'm sure.
Thanks!