Question: I have read the relevant pages on w3schools and other similar questions here but cannot seem to understand what's wrong about the following bit :

```
var myfunc03 = function (i) {
  document.getElementById('d01').innerHTML += 100-i+"<br>";
};

var myFunc01 = function() {
  i=0;
  while (i<100) {
    setTimeout(myfunc03(i), 1000)
    i++;
  }
};

```

when `myFunc01();` is run.

There's no pause whatsoever and all possible values for i is listed at once.

Is there a logical mistake here?

Answer: 
`while` waiting for `setTimeout` :

```
(async () => {
  var i = 0;
  while (await new Promise(resolve => setTimeout(() => resolve(i++), 1000)) < 100) {
    console.log("I get printed 100 times every second");
  }
})();

```
* I think you are missing a semicolon on the setTimeout and you should try passing the arguments in the below fashion:

```
setTimeout(myfunc03, 1000*i, i); 

```