HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to TypeScriptBasic TypesUnion & Literal TypesInterfacesTyped FunctionsArrays & TuplesGenerics & Enums
REFERENCE
📖 Overview
🖥️ Basics & Output
🏷️ Types
📐 Interface & Type Alias
🧩 Function
📋 Array & Object Types
Typed arr ( type[] )Tuple (tuple)Record<K, V>
🚀 Next
TypeScript›REFERENCE›Array & Object Types›Tuple (tuple)

Tuple (tuple)

An array with fixed length and types.

Syntax

let name: [type1, type2];

Description

The type and order of each position is fixed (e.g., [string, number]).

Example

Loading editor…

Expected output

Alex 36

When to use?

Fixed-structure pairs/triplets like name+age, coordinates.

Related commands

Typed arr ( type[] )
← Typed arr ( type[] )Record<K, V> →
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code