> For the complete documentation index, see [llms.txt](https://somerandomcat.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://somerandomcat.js.org/insiders/examples/random-joke.md).

# Random Joke

An example of how to generate a random joke!

## Code

```javascript
// This snippet uses some-random-cat version 2.0

const somethingRandom = require('some-random-cat').Random
somethingRandom.getJoke()
.then(res => {
    console.log(res)
    return
}) // Get the result
.catch(e => {
    console.error(e)
    return
}) // Catch the error
```

## Output

![Note: This returns a default JavaScript Object.](https://3133094034-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MNWYMnKi7gt-dpc7vrC%2F-MNW_MxIGL4J-ltolzsx%2F-MNWdE7mVsd0znL1XrV0%2Fjoke.PNG?alt=media\&token=014cefcc-d139-4aec-9ac2-7274244ec63e)
