Different Solution to overcome the above problem :

Using the ternary operator:

var vysh = { }
console.log([vysh.info](<http://vysh.info/>) ? [vysh.info.name](<http://vysh.info.name/>): undefined )

Using logical && operators:

var vysh = { }
console.log([vysh.info](<http://vysh.info/>) && [vysh.info.name](<http://vysh.info.name/>) )

Note: It is fine, but it is not recommended for a large nested structure.

Optional chaining:

var vysh = {
	info:{
		name: 'shivaji'
	}
}
console.log([vysh.info?.Name](<http://vysh.info/?.Name>) ) // trying to access declared object property
console.log(vysh.info12?.Name2 )  // trying to access the undeclared object property..