Questions about using web hosting

I want to use it to move to a specific blog site at random. Is it possible?
I have attached an example code.

<script>
blog = new Array('https://www.naver.com', 'https://www.google.co.kr' , 'https://www.daum.net' );
r = Math.floor( Math.random() * blog.length);
location.href = blog[r];
</script>

It was used as a Google translator, so the content may be awkward.