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 3.06
 * Using a variable as a property value
 */
var book;
var bookName;
bookName = "The Adventures of Tom Sawyer";
book = {
    title : bookName
};
/* Further Adventures
 *
 * 1) Run the program.
 *
 * 2) At the console prompt, type 'book'
 *    and press enter.
 *
 * The book object should be displayed on the console.
 * Its title property should have the same
 * value as the bookName variable.
 *
 * 3) Change the value of the bookName variable
 *    and try steps 1 and 2 again.
 * 
 */
Output

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

Dismiss x
public
Bin info
jrlarsenpro
0viewers