Why dont `if(slideArray[i].text) { text = slideArray[i].text; return}` instead?