let today = new Date(); let yesterday = new Date(); yesterday.setDate(today.getDate() - 1); console.log('Today: ' + today); console.log('Yesterday: ' + yesterday);