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 10.02
 * Longer strings as keys
 */
var ages = {};
ages["Kandra Smith"] = 56;
ages["Dax Aniaku"] = 21;
console.log(ages["Kandra Smith"]);
console.log(ages["Dax Aniaku"]);
/* Further Adventures
 *
 * 1) Add a couple more properties to the ages object.
 *    Include spaces and other characters
 *    in the keys.
 *
 * 2) Log the values to the console.
 *
 * 3) Try changing the properties so they
 *    use dot notation. What happens?
 *
 */
Output

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

Dismiss x
public
Bin info
jrlarsenpro
0viewers