Writing plugins with jQuery is relatively easy, just use $.fn and you're on your way. Like so:

```
$.fn.analyse = function() {
...
}

```

But what if you're not able to use jQuery?

Let's say I want to be able to use the following code:

```
document.querySelector("#mydiv").analyse();

```

I could go about it like this:

```
Object.prototype.analyse = function() {
...
}

```

But from what I understand it is frowned upon!