Skip to content

Type-checking

What is Type-checking?

The process of verifying that the data types used in a program (like ensuring a number isn't treated as text) are strictly correct, preventing runtime crashes.

In dynamic languages like JavaScript, a variable meant to hold an integer can accidentally be assigned text, causing the program to crash when run. Type-checking (via tools like TypeScript) enforces these constraints statically before the code runs. If a function expects a number, the type-checker throws an explicit error during development if you try to pass it a string.

How it relates to Orbit

Orbit can run a configured type-check script as part of a project’s QA checks. See QA Intelligence for details.

When you would use it

You rely on type-checking to significantly reduce unpredictable bugs in large applications, ensuring that different modules pass data to each other in the exact expected format.

Common operations

  • Defining strict interfaces for API responses to guarantee data structures.
  • Catching basic logic errors in the IDE before the code is compiled.

Related terms

Where this is taught