{
title: "This is title of item 1",
desc: "This is description of 1",
state: "inactive",
toggleState: () => {
console.log('title: ', title)
}
}
This is an object in Typescript. I want to access title variable from this object in this object's function toggleState(). But I get error as
[ts]: Cannot find name 'title'
Is it possible? if so, then how to achieve it?