Which side are you? Javascript or Typescript
But a statically typed language would catch those errors before it even compiles...