JS Coding Questions Logo
JS Coding Questions
#141💼 Interview💻 Code

Can we define properties for functions

Advertisement

728x90

Yes, we can define properties for functions because functions are also objects.

javascript
1fn = function (x) {
2  //Function code goes here
3  };
4
5fn.name = "John";
6
7fn.profile = function (y) {
8  //Profile code goes here
9};

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 56

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
141of476