First-class object

Updated: 12/31/2022 by Computer Hope

In computer programming, a first-class object, first-class citizen, or first-class value is a language entity (e.g., function or variable) that operates as other entities in a language.

For example, in the C programming language, you cannot pass a function to another function as a parameter. So in C, functions are called "second-class objects." However, in JavaScript a function can be passed to another function as a parameter, therefore in JavaScript, functions are first-class.

Programming terms, Value