I have the following code. I would like to make it so that it delivers a href depending on the random array item served (which are the latter parts of the URL). In other words, it should randomly take you to either the Blog (http://website.com/blog), About page or Home page. I have taken note of the method used here: Getting a random value from a JavaScript array, but they only console log the output. I cannot find any examples of how I would then put that output into the latter part of the href.
<a id='link' href='http://website.com/'>Click me</a>
<script>
var pages = ['blog','about','home'];
</script>
I expect any answer will use the javascript math.random() function but I have left it out of my question to prevent making it more messy than necessary if I do not use it the most efficiently.