Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/* Get Programming with JavaScript
 * Listing 4.07
 * Using the findTotal function to display a calculation
 */
var number1 = 1000;
var number2 = 66;
var result;
var findTotal;
findTotal = function () {
    result = number1 + number2;
};
findTotal();
console.log(number1 + " + " + number2 + " = " + result);
/* Further Adventures
 *
 * 1) Change number1 and number2
 *    and run the program.
 *
 * 2) Add a third variable, number3,
 *    and assign it a value.
 *
 * 3) Update the findTotal function
 *    to add the three numbers.
 *
 * 4) Update the console.log line
 *    to show the new calculation.
 *
 */
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
jrlarsenpro
0viewers