First-class object

Updated: 04/26/2017 by Computer Hope

In computer programming, a first-class object, also known as a first-class citizen or a first-class value, is a language entity — a number, a function, or a variable, for instance — that can be operated on in the same way as any other entity in the language.

For example, in the C programming language, you cannot pass a function to another function as a parameter, so in C, functions are referred to as "second-class objects." In JavaScript, however, a function can be passed to another function as a parameter just like any other value, therefore in JavaScript, functions are first-class.