practiced tuples

This commit is contained in:
umamahesh.b
2026-08-12 13:47:59 +05:30
parent 87816dfbf4
commit a3b4e8aab3
3 changed files with 15 additions and 3 deletions
+7 -2
View File
@@ -24,9 +24,14 @@ function numbers(a:number,b:number) : number{
numbers(2,3)
// Arrays
const elements:string[] = ['Hydrogen', "Zinc", "Carbon"]
elements.map((element) => element)
// Tuples
let place:[string, number] = ['Yemmiganur', 518360]
// place[0]. you will get all string built in functions
// place[1]. you will get all number built in functions
place.push('Great')
console.log(place, 'this is place')