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>
  <script>
    (function() {
      function CacheEntry(filter, offset) {
        this.filter = filter;
        this.offset = offset;
      }
      CacheEntry.prototype.toString = function() {
        return "[Cache: " +
          this.filter + "|" +
          this.offset + "]";
      };
      var a = new CacheEntry("transform", 10);
      var b = new CacheEntry("opacity", 22);
      var cache = {};
      
      cache[a] = "Hi there";
      display("cache[a] = " + cache[a]);
      display("cache[b] = " + cache[b]);
      
      function display(msg) {
        var p = document.createElement('p');
        p.innerHTML = String(msg);
        document.body.appendChild(p);
      }
    })();
  </script>
</body>
</html>
Output 300px

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

Dismiss x
public
Bin info
anonymouspro
0viewers