Tuple

  1. κ³ μ •λœ 길이의 λ°°μ—΄
  1. κ³ μ •λœ νƒ€μž…μ˜ λ°°μ—΄
role: [number, string]; // tuple type

Tuple

νŠœν”Œμ΄λž€, λ°°μ—΄μ˜ 길이가 κ³ μ •λ˜κ³  각 μš”μ†Œμ˜ νƒ€μž…μ΄ μ§€μ •λ˜μ–΄ μžˆλŠ” λ°°μ—΄ ν˜•μ‹μ„ λ§ν•œλ‹€.
let arr: [string, number] = ["hi", 10];
λ§Œμ•½, μ •μ˜ν•˜μ§€ μ•Šμ€ νƒ€μž…, 인덱슀둜 μ ‘κ·Όν•  경우 였λ₯˜κ°€ λ‚œλ‹€.
arr[1].concat("!"); // Error, 'number' does not have 'concat' arr[5] = "hello"; // Error, Property '5' does not exist on type '[string, number]'
let myList: [number, string] = [ [1, "Steve"], [2, "Bill"], [3, "Jeff"], ]; myList.push([4, "HUN"]);
Β