Four. Ts data types
- tuple (a tuple type): Specifies the type of data can be stored to the array location specified
例:let arr:[number, string] = [123, ‘123’];
- enum (enumeration): the digital conversion of the identifier
Example: enum {enum name identifier Shaping = constant, ...};
Call: the name of the enumeration identifiers (Note: identifiers can be written directly write or string)
- any (any type): You can easily type assignment
- Anonymous function: var fun = function run (): string {
return ‘run’;
}
- The default value of the function:
Function test (name ?: string) {...}: the name of the parameter with? This parameter can be passed on behalf of not pass, this parameter should be placed last
Function test (name: string = null) {...}: This parameter has a default value is null if passed
- Conversion Type
this as any: shows a type of this is converted into any