<body>
<button onclick="myFunction()">Try to it</button>
<p id="sokol"></p>
<script type="text/javascript" language="JavaScript">
var mas = ['orange', 'banana', 'pineapple', 'mango'];
function myFunction() {
document.getElementById('sokol').innerHTML = mas;
mas.pop();
}
</script>
</body>