var str; var displayedNum; for (i in imgURLArray){ str = \"\" + \"\"+ (1+i) + \"\" + \"\
You could just use the parseInt method:
var str = "foobar" + (parseInt(1+i)) + "other stuff";