I have build an array loader with javascript.
When I directly click last, I get undefined. I tryed to catch it up with something like this
var lastWord = (function() {
return function() {
var resultWord = wordArray[--count % wordArray.length];
if (typeof resultWord == "undefined")
{
return false;
}
else
{
return wordArray[--count % wordArray.length];
}
}
}
}());
But didn't worked, any suggestions?