type coercion

Converting a value from one type to another, such as the text "8080" into the number 8080.

In more detail

Environment variables are always text, so a port number has to be coerced into a real number while being validated. Without coercion, "8080" + 1 would give "80801" instead of 8081.

Related terms

Taught in

References