Obtenga la fecha de fecha ayer Angular

const today = new Date()
const yesterday = new Date(today)

yesterday.setDate(yesterday.getDate() - 1)

today.toDateString()
yesterday.toDateString()
Confused Chinchilla