practiced intersection and literal

This commit is contained in:
umamahesh.b
2026-08-12 15:47:46 +05:30
parent 2973a86200
commit a32e14e45a
3 changed files with 32 additions and 1 deletions
+24
View File
@@ -56,3 +56,27 @@ function changeCMtoMM(dime : (number | string)){
}
}
console.log(changeCMtoMM("20"))
// intersection Type || you can combine two types in this
type employee = {
name : string,
id: number,
}
type manager = {
extraPowers: boolean
}
const CEO:(employee & manager) = {
name: "uma",
id: 89,
extraPowers: true
}
// Literal Type || constant type values.
let rice:20 = 20;
console.log(rice, "Rice")