how about?
```
for (var i = 0; i < _callbacks.length; ++i) {
  if (_callbacks[i] == null || _callbacks[i] == undefined)
    return i;
}

return i;
```