-1

Is there any difference between these two? From what I am seeing the result is being the same. When should I use each of these?

const item = null
const test = item || "hey"
const test2 = item ?? "hey2"

console.log(test, test2)
squnk
  • 318
  • 1
  • 8

0 Answers0