Here are what I think the ideal semantics are, if we were being rigid about this:

```js
if (timeout !== undefined) {
    timeout = Number(timeout);
    if (!isFinite(timeout) || timeout <= 0) {
        throw new RangeError("bad news bears");
    }
}

// later
if (timeout === undefined) {
    // don't use timeout
} else {
    // safe to use
}
```

Any tips on how to express this in JS?