How can I declare an object with properties that I will be passing around inside of my function using Typescript?
- by Marilou
I've been using the following:
var modal = {
content: '',
form: '',
href: ''
}
But now I have started to use Typescript is there a better way I can declare an object and how can I declare the types of my properties. The reason I am using this object is that it's inside of a function and inside that function I have other functions that set and use the values of the properties. Is this the best way for me to do this or is there another way I could better do this with typescript?