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 233 views
1 answer 210 views
2 answers 304 views
1 answer 236 views
1 answer 228 views
1 answer 211 views
211 views asked Aug 13, 2022 by avibootz
1 answer 242 views
...