Skip to content

What is a first class function? #349

Answered by d4tdev
montasim asked this question in Q&A
Discussion options

You must be logged in to vote

A programming language is said to have First-class functions when functions in that language are treated like any other variable. For example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable.

First-class functions are functions that are treated as variables. They can also be parsed into other functions as arguments.

In JavaScript, functions are treated as values or just another type of object

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by montasim
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants