Expected an assignment or function call and instead saw an expression no-unused-expressions What's wrong?

  • 0
    let WorkTimeSet: {
    StartTime: {
    hours: new Date (). getHours (),
    minutes: new Date (). getMinutes (),
    seconds: new Date (). getSeconds ()
    },
    EndTime: {
    hours: new Date (). getHours (),
    minutes: new Date (). getMinutes (),
    seconds: new Date (). getSeconds ()
    },

    WorkFor: {
    hours: '',
    minutes: '',
    seconds: ''
    },
    WorkingForGetter: function () {
    this.WorkFor.hours = new Date (). getHours () - this.StartTime.hours, // error before this
    this.WorkFor.minutes = new Date (). getMinutes () - this.StartTime.minutes,
    this.WorkFor.seconds = new Date (). getSeconds () - this.StartTime.seconds

    }


    }
    JavaScript Anonymous, Dec 7, 2019

  • 1 Answers
  • 0
    Replace ':' with '='

    let WorkTimeSet = {...}



    interactive
    Ryder Myers

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!