JavaScript Exercise #1

JavaScript is a programming language that can be embedded within HTML. It is the most-used programming language in the world.

Watch this video about the language.

Make a new folder called JavaScript1 and add an index.htm file that links to five examples, like this:

<h1> My Five JavaScript Programs </h1>
<h3> ______Put your name here________ </h3>
<a href=javascript1.html> Calculating a number and writing </a>
<a href=javascript2.html> Find the minimum value </a>
<a href=javascript3.html> Loop through an array and display with an ordered list </a>

Link to this index.htm file from your assignments page.

Implement these examples as 7-1.html, 7-2.html, 7-3.html, etc., and place in your JavaScript1 folder.

*** My suggestion is to get the original examples to work before changes are made ***

1) Change the calculation in the following example:


2) Add more numbers to the list:

3) Add a fruit:

4) Button and sorting an array (add another fruit):

5) Random number call. Make random number range between 0-10 by integrating code sample at bottom:


The following function is included here to show how the myFunction function above could be modified to determine a random number between a minimum and maximum value.