dynamic typing

A language design where a variable can hold a value of any type and types are only checked while the program runs.

In more detail

Types belong to values rather than to variable names, so the same variable can hold a number now and a string later, and you never declare its type. Mixing incompatible types shows up as an error only when the bad line executes. JavaScript and Python are dynamically typed, while statically typed languages such as Java and Go check types before the program runs.

Example

Because JavaScript is dynamically typed, V8 watches which types really occur and optimises for those.

Related terms

Taught in

References