Skip to main content
InterviewHubPRO
Section Overview
Q145

Question 145 of 536

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

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

Can we define properties for functions

mid LevelCode ExampleHTTP & REST APIs

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
  };