Here's a simplified version of our original code:
const start: number = 10
const end: number = 20
(someElement as HTMLInputElement).setSelectionRange(start, end)
We encountered an error with the 20, where a red squiggly line appeared indicating: This expression is not callable Type 'Number' has no call signatures. The solution we found was to add a semicolon:
const start: number = 10
const end: number = 20;
(someElement as HTMLInputElement).setSelectionRange(start, end)
Any thoughts on why it compiled in that way? It seems like typescript being transformed into javascript interpreted the code differently and tried to treat the end
variable as a function.
const start: number = 10
const end: number = 20(someElement as HTMLInputElement).setSelectionRange(start, end)