JS Daily 17 - Non Existent Object Property

Published on 7 Dec, 2020

What is the output of following code?

const obj = {
  name: "Backbencher"

The output is undefined.

obj is an object literal. We are trying to access the value of a property that is not present in obj. It results in undefined.