Notes on default ES behavior
Louis
Posted on December 7, 2021
const n = null
console.log(n?.something) // undefined
const o = {}
console.log(o?.something) // undefined
function test(d = 0) {
console.log({ d })
}
test(o?.something) // { d : 0 }
test(n?.something) // { d : 0 }
💖 💪 🙅 🚩
Louis
Posted on December 7, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.