I'm trying to do a for loop in a string. This is what I have:
slideContainer.append('<div>' + for( i=0; i<=slideCount-1; i++ ){'<a>' + (i+1) + '</a>'} + '</div>');
What I want is for it to end up like this:
<div>
<a>1</a>
<a>2</a>
<a>3</a>
<a>4</a>
<a>5</a>
</div>
but I'm getting an error:
Uncaught SyntaxError: Unexpected token (
It's referring to the one next to 'for'. What's going on?