Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

type script tuple type

// Declare a tuple type
let x: [string, number];
// Initialize it
x = ["hello", 10]; // OK
// Initialize it incorrectly
x = [10, "hello"]; // Error
Type 'number' is not assignable to type 'string'.Type 'string' is not assignable to type 'number'.23222322Type 'number' is not assignable to type 'string'.Type 'string' is not assignable to type 'number'.Try
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #type #script #tuple #type
ADD COMMENT
Topic
Name
1+8 =