How to concatenate value to exsiting elements in a tuple with TypeScript

1 Answer

0 votes
let tpl: [number, string] = [1, "TypeScript"];

tpl[1]  = tpl[1].concat(" Programming");

for (var t of tpl) {
    console.log(t); 
}
 



 
/*
 
run:
 
1 
"TypeScript Programming"

*/

 



answered Oct 23, 2021 by avibootz

Related questions

1 answer 155 views
1 answer 116 views
2 answers 172 views
1 answer 149 views
1 answer 143 views
1 answer 123 views
123 views asked Aug 13, 2022 by avibootz
1 answer 153 views
...