Acutally, I'll leave it as is - or else it'll have to be `template.replace('{'+(i-2)+'}', arg);`. That's even weirder...