I'm new to js. I thought it is ok to concatenate variables and strings. Can someone please tell me why the below prints:

images/dwa76_1.jpg
images/dwa76_1.jpg
images/dwa76_1.jpg
images/dwa76_1.jpg

instead of:

images/dwa76_1.jpg
images/dwa76_2.jpg
images/dwa76_3.jpg
images/dwa76_4.jpg

var num = 1;

var newThumbnailImg = "images/dwa76_" + num + ".jpg";

function initAll(){
document.write(newThumbnailImg + "<br>");
num++;
document.write(newThumbnailImg + "<br>");
num++;
document.write(newThumbnailImg + "<br>");
num++;
document.write(newThumbnailImg + "<br>");
}