scrimba
Understanding Typescript In Depth
Typescript -Section 2 Combing Types #18
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Typescript -Section 2 Combing Types #18
AboutCommentsNotes
Typescript -Section 2 Combing Types #18
Expand for more info
index.ts
run
preview
console
interface TypeA {
a: string
b:string
}
function intersectGenerics<T1>(t1: T1): T1 & TypeA {
const x : TypeA = {a: "A" , b : "B"};
return (<any>Object).assign({}, x, t1);
// Object.assign({}, {x:10}, {y:70})
}
Console
"Hello from JavaScript"
,
index.html
-5:59