mishoo/UglifyJS — Issue #242: Optimising typeof 'foo' === ....
Author: josephg
Created: 2011-10-09 20:33:10+00:00
State: open

There are a bunch of little optimisations you can do to compress `typeof foo === 'type literal'` expressions.

```javascript
typeof foo === 'number'
```

can be written as:

```javascript
foo===+foo
```

```javascript
typeof foo.bar === 'undefined'
```

can be written as (unsafe):

```javascript
foo.bar===undefined
```

or (safer, smaller)

```javascript
// top of file
var __undefined = void 0;

foo.bar===__undefined
```