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 CodingAdvertisement
728x90
141of476