A colleague of mine was investigating a peculiar bug within a separate company's codebase. They needed to observe the bug in staging, and got to the point where `console.log` was the best/only approach.

_However_, the deployment pipeline for this repo had a linting step which threw...

```
Calls to console.log are not allowed (no-console.log)
```

Pretty fair call… just not ideal when spelunking, and without permissions to update the pipeline's tslint config **what to do?**

* * *

### Initial approach

The above situation sparked a wonderful office collaborative challenge of _"how can we outsmart/confuse the linter"!_

> "..how about simply accessing `log` via a string on `console`?"

```
console["log"]("YOU'RE NOT MY SUPERVISOR!!!");
```

This was however met with...

```
Object access via string is disallowed (no-string-literals)
```

_Caught again!_

* * *

### Finally

> "What about trying to assign a variable to console?"

````
const braveheart = console;
braveheart.log("FREEEEEDOM!!!")````

#### _Success!_

A subsequent solution included simple destructuring...

```
const { log: forrest } = console;
forrest("Run forrest run!!");
```

Ultimately it was a few minutes of fun in enjyoing how versatile javascript is. While tslint is incredibly clever, (and it is) there's always a way to outsmart it!
