InterviewHubPRO
Section Overview
Q145

Question 145 of 521

Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

28%
JavaScript Internals (521 Qs)•Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

Can we define properties for functions

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

javascript
  fn = function (x) {
    //Function code goes here
  };

  fn.name = "John";

  fn.profile = function (y) {
    //Profile code goes here
  };