Answers for "empty object typescript"

3

init empty object typescript

type User = {
    Username: string;
    Email: string;
}

const user01 = {} as User;
const user02 = <User>{};

user01.Email = "[email protected]";
Posted by: Guest on May-27-2020
1

how to create empty object typescript

const _params = {} as any;

 _params.name ='nazeh abel'
Posted by: Guest on May-26-2020
0

empty object typescript

type EmptyObject = {
    [K in any] : never
}

const one: EmptyObject = {}; // yes ok
const two: EmptyObject = {a: 1}; // error
Posted by: Guest on October-13-2021

Code answers related to "empty object typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language