Advertisement
andreterceiro

Untitled

Oct 18th, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Container {
  2.     /**
  3.      * Store what you want
  4.      *
  5.      * @var {Object}
  6.      */
  7.     props = [];
  8.  
  9.     /**
  10.      * Getter
  11.      *
  12.      * @param {String} value What you want to get
  13.      * @returns {*} What you want to get
  14.      */
  15.     get(value) {
  16.         return props[value];
  17.     }
  18.  
  19.     /**
  20.      * Setter
  21.      * @param {String} key   The key. After, you use this key to retrieve what is stored
  22.      * @param {*}      value The value to store
  23.      *
  24.      * @returns{Boolean} Returns true
  25.      */
  26.     set(key, value) {
  27.         props[key] = value;
  28.  
  29.         return true;
  30.     }
  31. }
  32.  
  33. module.exports.Product = Product
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement