daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Dec 10th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const now = new Date();
  2. class Item {
  3.   constructor(options = {}) {
  4.     this._id = options.id;
  5.     this._date = now.toDateString();
  6.     this._timestamp = now.getTime();
  7.     this.description = options.description;
  8.     this.isStarred = options.isStarred || false;
  9.     this.boards = options.boards || [];
  10.   }
  11. }
  12.  
  13. const Item = require('./item');//this would be equivalent to <script src='item.js'></script>
  14. class Task extends Item {
  15.   constructor(options = {}) { // const task = new Task({id, description, boards, priority});
  16.     super(options);
  17.     this._isTask = true;
  18.     this.isComplete = options.isComplete || false;
  19.     this.isStarred = options.isStarred || false;
  20.     this.priority = options.priority || 1;
  21.   }
  22. }
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
 
Top