Create the script once and reference in any number of ways. The example goes into Date Stamps, News, Quotes, etc. One file to update and one line to include in the HTML page.You can use this as a fake Server-Side Includes to create site navigation. You update the one .js file to alter navigation.
A random number is useful- if not required- in the creation of many popular JS applications, such as a dice, random image script, or random link generator. Learn how to generate a random number in JavaScript.