type for empty object code example
Example 1: javascript check if object is empty
function isObjectEmpty(obj) {
return Object.keys(obj).length === 0;
}
Example 2: init empty object typescript
type User = {
Username: string;
Email: string;
}
const user01 = {} as User;
const user02 = <User>{};
user01.Email = "[email protected]";
Example 3: how to create empty object typescript
const _params = {} as any;
_params.name ='nazeh abel'