Advertisement
pcwizz

attempt at a javascript object

Mar 3rd, 2014
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function group(group){
  2.     this.group = group;
  3.     this.deleted = new array();
  4.     this.added = new array();
  5.     this.returnGroup = returnGroup;
  6.     function returnGroup(){
  7.         return this.group;
  8.     }
  9.     this.pushDeleted = pushDeleted;
  10.     function pushDeleted(deleted){
  11.         this.deleted.push(deleted);
  12.     }
  13.     this.removeDeleted = removeDeleted;
  14.     function removeDeleted(deleted){
  15.         this.deleted.splice(dualHeadedSearch(this.deleted, deleted),1);
  16.     }
  17.     this.returnDeleted = removeDeleted;
  18.     function returnDeleted(){
  19.         return this.deleted;
  20.     }
  21.     this.pushAdded = pushAdded;
  22.     function pushAdded(added){
  23.         this.added.push(added);
  24.     }
  25.     this.removeAdded = removeAdded;
  26.     function removeAdded(added){
  27.         this.added.splice(dualHeadedSearch(this.added, added),1);
  28.     }
  29.     this.returnAdded = removeAdded;
  30.     function returnAdded(){
  31.         return this.added;
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement