In my experience, I've come across typescript objects that are defined in the following way:
const MyObj = {
myVar1,
name1: myVar2
}
Can someone explain the purpose of this object?
I know that there is a key-value pair with name1
as the key and myVar2
as the value. But what is the significance of having just a single value like myVar1
?
(I've struggled to find a clear answer to this online)