practiced tuples
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user