I am using TypeScript with React.js. Even though I declared variables' type as string in my interface, when I upload Excel sheet, if there is a number, it treats it as number. All I need to treat it as string.
let data = XLSX.utils.sheet_to_json(ws, {
header: headers,
range: 1
}) as Array<Types.IExcelCourseRow>;
My IExcelCourseRow is:
{
courseCode?: string;
...
}
Whenever my courseCode is 123, it treats is as 123. I need it to treat courseCode as '123'. What can I do?