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.