Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Named types just give a name to a type

type One = { p: string };
interface Two {
  p: string;
}
class Three {
  p = "Hello";
}
 
let x: One = { p: "hi" };
let two: Two = x;
two = new Three();
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #Named #types #give #type
ADD COMMENT
Topic
Name
4+1 =