I don't understand why the following code does not cause potential race condition. It looks like `count` and `totalBytes` are variables that can be accessed by multiple callback functions and I felt `count--` and `totalBytes += stats.size` might cause racing because you can't guarantee the orders of the callback functions passed to `fs.stat()` (as it's an IO operation).

```
var fs = require('fs');

var count = 0,
    totalBytes = 0;

function calculateByteSize() {
    fs.readdir(".", function (err, filenames) {
        var i;
        count = filenames.length;

        for (i = 0; i < filenames.length; i++) {
            fs.stat("./" + filenames[i], function (err, stats) {
                totalBytes += stats.size;
                count--;
                if (count === 0) {
                    console.log(totalBytes);
                }
            });
        }
    });
}

calculateByteSize();

```