Function are objects in javascript??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Function are objects in javascript???

Can anyone explain this statement. Are functions objects in other sense they just behave like objects??

3rd Jul 2019, 11:03 AM
John Dhinakar
John Dhinakar - avatar
1 Answer
+ 7
Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value. In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object.
3rd Jul 2019, 11:15 AM
Muaz Ahmad
Muaz Ahmad - avatar