Notes on default ES behavior

louisgv

Louis

Posted on December 7, 2021

Notes on default ES behavior
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 }
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
louisgv
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.

Related

Notes on default ES behavior
javascript Notes on default ES behavior

December 7, 2021