Hi I have 2 lines of code, 1 creating date object, 1 set new date to yesterday.
yesterday = new Date () ;
this.yesterday.setDate(this.yesterday.getDate()-1);
How can I simplfy the code and do the work in a single line?
Something like this
yesterday = new Date ().setDate(this.yesterday.getDate()-1);
Or this
yesterday = new Date ()=>{setDate(this.yesterday.getDate()-1)};
Is it even possible? Thanks in advance :)