What is the difference in this instance between using the optional chaining with nullish coalescing and or operator when the value it's undefined? the both seem to be working alike.
Which one it's prefered and why?
const api = {
entry: undefined
}
const obj_nullish = {
foo: api?.entry ?? 'Not found'
}
const obj_or = {
foo: api.entry || 'Not found'
}
console.log(obj_nullish)
console.log(obj_or)