how can I do following code in typescript like python?
let startDay: Date = new Date();
let startDay: string = `${startDay.toLocaleDateString('en-US')}`
? or I have to declare two different variable for type convention?
Yo cannot declare the same variable twice in the same context. Javascript or Typescript will not let you do it. Furthermore, Typescript does not allow type mutation so if you use a Date type first, it cannot be changed.
If you don’t need to use the Date version just omit its declaration:
let startDay: string = new Date().toLocaleDateString('en-US');
${...}is unnecessary here, you could just writestartDay.toLocaleDateString('en-US')since that returns a string anyway.