ts-quiz— ~/quiz/levels.ts
tsc --watch● loading…
// tsc --watch · type-checking modules…
await load("quiz/levels.ts")
// streaming server components
◇ tsc 6.0.3 · compiling…UTF-8◇ scanning levels…
type Person = {
name: string
age: number
}
type Employee = {
name: string
email: string
}
type A = Person | Employee;
type B = Person & Employee;
const a: A = {
name: 'John',
age: 20,
email: 'john@test-email.co.uk',
}
const b: B = {
name: 'John',
age: 20,
email: 'john@test-email.co.uk',
}
console.log('A:', a.name, a.age, a.email)
console.log('B:', b.name, b.age, b.email)