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 2.08
 * Using a variable’s current value to set its new value
 */
var score;
score = 100;
console.log("Your score was " + score);
console.log("Great splat!!!");
score = score + 50;
console.log("New score: " + score);
console.log("Way to go!");
/* Further Adventures
 *
 * The player splats a kumquat.
 * Add code to:
 *
 * 1) Tell the player of a successful splat
 *
 * 2) Add 100 to the player's score
 *
 * 3) Show the new score
 *
 * 4) Display a message of congratulations
 *
 */
Output

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

Dismiss x
public
Bin info
jrlarsenpro
0viewers