I'm trying to define an object and then set its values based on specific conditions. However, I'm encountering the error message "Variable 'answer' is used before being assigned" with this code snippet. Can you help me understand why?
let answer: {
diff: number | undefined,
value: number | undefined,
}
if(answer.diff === undefined) {
console.log('not defined')
}