How to declare multiple variables in one line with TypeScript

1 Answer

0 votes
const a: number = 6, b: number = 9, c: number = 5;
  
console.log("a = " + a);
console.log("b = " + b);
console.log("c = " + c);   
   

   
   
/*
run:
    
"a = 6" 
"b = 9" 
"c = 5" 
    
*/

 



answered Oct 28, 2021 by avibootz

Related questions

...