Hello guys my friend Spiritx asked a good question on this website about how to show a objects contents using `innerHTML` so he shared this with me so I enjoyed this script so I decided to add this to my collections of scripts. So I accidentally press the button more than once and the objects contents keep on showing more than once every time I press the button so how can I show the objects output one time? Regardless how many times I press the button and I asked him if he knows how to show this one time but he doesn't know how here's the code to see what I mean. 

```js
 function output_object(){ 
var student = {
    name: "Dave ",
    grades: [80, 85, 90 ,95]
    };

    for (index in student ) {
    document.getElementById("x").innerHTML += student[index];
    }
}
```

```html
<p id="x"></p>
  <button onclick="output_object()">Click</button>
```