Type coercion

/taɪp koʊˈɜrʃən/ noun

Definition

The automatic or explicit conversion of a value from one data type to another by the programming language or programmer.

Etymology

Coercion comes from Latin 'coercere' meaning to constrain or force. In programming, it describes how languages 'force' values to change type, either automatically (implicit) or through programmer commands (explicit).

Kelly Says

JavaScript's type coercion can be wonderfully weird - it thinks '1' + 1 equals '11' but '1' - 1 equals 0! This happens because addition can mean string concatenation, but subtraction can only mean math, so JavaScript makes different assumptions.

Related Words

Explore More Words

Get the Word Orb API

Complete word intelligence in one call. Free tier — 50 lookups/day.