DEV Community

loading...

Discussion on: Add properties to functions

Collapse
z00md profile image
z00md

That's a very short article:-D. Just to add, functions are first class objects so everything that is applicable to objects is also true for functions. The problem is how dev tools outputs differently for functions and objects. If you do console.log(func), you will see the function definition which leads us to believe that it cannot have properties. To see the function properties as object you can use console.dir(func).

Collapse
318097 profile image
Mehul Lakhanpal Author

Yes, I am focusing on short articles only. Anyways thanks for the knowledge 😊