CodesJava

Easy learning with example program codes

TypeScript tuple tutorial


TypeScript tuples:

Typescript tuple represents a heterogeneous collection of values i.e. it contains a collection of values of different types.

Syntax:

var tupleName = [value1,value2,value3,…valuen]

Example:

function tupleTest(values):void{
  for (i=0;i<values.length;i++){  
    console.log(values[i]); 
  }
}
var values = [10,20,"Gunjan","Rajeev","Vikram","Sudhir"];
tupleTest(values);

Try it:

JS Bin on jsbin.com

Please follow and like us:


Copyright © 2019 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki