Guest User

Untitled

a guest
Dec 10th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment