An Input/Output Script that averages two numbers.

To appreciate this example, see the previous example which doesn't work properly.

Prompt windows always return strings even if you enter numbers. The solution to getting the + operator to add instead of concatenate is simply to convert the strings into numeric storage format.

This example uses the built-in parseFloat() function which will convert a string into numeric format (if possible).
Float refers to "Floating Point" decimal.
JavaScript also has a built-in parseInt() function which will also convert a string to numeric format.
Int refers to Integer, so this function will remove any decimal places during the conversion.