I am wondering how to make this if loop pause once every second before continuing to count the amount of "candy" I have.

Edit: I want to pause so that every second the amount of candy I have goes up by 1. Currently the display starts showing 1 through 10. I'm attempting to copy the effect done here (I'm very new to JavaScript): <http://candies.aniwey.net/>

```
//booleans
var count = new Boolean;
count = true;
//integers
var candy = 0;

//strings
var txt = "You have ";
var txt1 = " candies.";
var br = "<br>";

//loops
while (candy <= 10) {
    if (candy == 0) {
        document.write(txt + candy + txt1);
        document.write(br);
        candy++;
    } else if (candy == 1) {
        document.write(txt + candy + " candy.");
        document.write(br);
        candy++;
    } else {
        document.write(txt + candy + txt1);
        document.write(br);
        candy++;
    }
}

```