Announcement

Collapse
No announcement yet.

functions are objects in JavaScript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • functions are objects in JavaScript?

    functions are objects in JavaScript?
    ​​​​​​

  • #2
    Yes, it is

    generally in javascript everything is object.

    Code:
    function test() {
    
    }
    
    test.add = 5
    so, every function is represented as an object, it has all the properties of that function.

    Comment


    • #3
      In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object. What distinguishes them from other objects is that functions can be called. In brief, they are Function objects

      Comment

      Related Topics

      Collapse

      Working...
      X