If I create an object by doing let obj = {}, I can create a new link property by doing obj.link = 'test' and it works.
What if I want instead to create a nested property?
The code below gives an undefined error:
let obj = {}
obj.link.link = 'test'
console.log(obj.link.link)
What's the right way to do this?
obj.link = {link: 'test'}