SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const productOperations = {
  2.     products : [],
  3.     add(product) {
  4.         this.products.push(product);
  5.         console.log("product added ",this.products);
  6.     },
  7.     toggleMark(id) {
  8.         var productObject = this.products.find(product=>product.id == id);
  9.         productObject.addToCart = true;
  10.         productObject.email = loadUser();
  11.         console.log("Add to cart ",productObject);
  12.         savetoServer(productObject);
  13.     },
  14.     countMark() {
  15.         return this.products.filter(product=>product.addToCart).length;
  16.     },
  17.     remove() {
  18.        
  19.     },
  20.     search(id) {
  21.        
  22.     },
  23.     update() {
  24.  
  25.     },
  26.     sort() {
  27.  
  28.     }
  29.    
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top