fork(1) download
  1. // your code goes here
  2. var ItemManager = (function(){
  3. var items=[];
  4.  
  5. var p = function(){
  6. };
  7.  
  8. p.prototype.addItem = function(item){
  9. items.push(item);
  10. };
  11.  
  12. p.prototype.debug = function(){
  13. print(items);
  14. };
  15.  
  16. return p;
  17. })();
  18.  
  19. var a=new ItemManager();
  20. a.addItem("a");
  21. var b=new ItemManager();
  22. b.addItem("b");
  23.  
  24. a.debug();
  25. b.debug();
Success #stdin #stdout 0.02s 4940KB
stdin
Standard input is empty
stdout
a,b
a,b