avatar
operands of '+' operation in Typescript TypeScript
/** Intialize */
const date = new Date();
const currentYear = date.getFullYear();
const currentMonth = date.getMonth();
const currentDay = date.getDate();

/** Before */
const ext = '.pdf';
const pdfFile = personID + currentDay + '/' + currentMonth + '/' + currentYear + ext;

/** After */
const ext = '.pdf';
const pdfFile = `${personID}${currentDay}/${currentMonth}/${currentYear}${ext}`;
You need to login to do this manipulation!