Run ❯
Get your
own Node
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
// Convert all properties to boolean type Flags
= { [K in keyof T]: boolean; }; interface User { id: number; name: string; email: string; } const user: User = { id: 1, name: "Alice", email: "alice@example.com" }; function createFlags
(obj: T): Flags
{ const out: any = {}; for (const k in obj) out[k] = true; return out; } const userFlags = createFlags(user); console.log(userFlags.id); console.log(userFlags.name); console.log(userFlags.email);
true true true