Im trying to understand why changing the parameter in the function, changes the original value like here:
let originalDate = new Date()
console.log('originalDate before: ', originalDate)
changeDate(originalDate)
console.log('originalDate: after', originalDate)
function changeDate(date: Date) {
date.setHours(0, 0, 0, 0)
}
What exactly is causing this?