> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/js/debugging.md).

# Debugging

Great playground in chrome console

### Most common errors

1. Thinking the value is invalid when it is actually undefined
2. Not awaiting for a promise
3. Can't do await in map/filter ft
4. Equality and booleans are jank in js
   1. `[] !== []` |  `Boolean([]) === true`&#x20;
5. Problems with variable hoisting(using value before its defined, without throwing error)

## Console

```javascript
console.log( { x }); //{ } prints it as a dict so you get the variable name
console.table([1, 2]); // log in table 
console.trace('hi'): //will do stack trace

//Can compute performace
console.time("looper");
//some op
console.timeEnd("looper"); //=> looper: 4.3ms
```

### Is something you are requiring undefined?

* Circular dependency, module.exports will just return null
