I have recently seen ??
in JS, or maybe it's a Typescript thing. It seems to behave the same as ||
code looks something like this
import GeneralImage from './images'
const Team = ({ teamImg }) => {
return <img src={teamImg ?? GeneralImage} />
}
I would have thought to have done the following, but maybe there is a difference. Cannot find anything online for ??
but the linter doesn't seem bothered and it works the same.
const Team = ({ teamImg }) => {
return <img src={teamImg || GeneralImage} />
}