Initialize empty object and add props
Β· β 1 min read
There are situations when you need to initialize object without props. How do you manage that it Typescript?
Letβs consider the example below. First, we declare the object and initialize it to an empty object.
1 const planet = {}; Then, we add the props -
1 planet.