About 354,000 results
Open links in new tab
  1. Functions - JavaScript | MDN - MDN Web Docs

    Mar 7, 2025 · In JavaScript, functions are first-class objects, because they can be passed to other functions, returned from functions, and assigned to variables and properties. They can also have properties and methods just like any other object.

  2. Function - JavaScript | MDN - MDN Web Docs

    Jul 15, 2024 · These properties are own properties of each Function instance. The display name of the function. Specifies the number of arguments expected by the function. The name of the function. Used when the function is used as a constructor with the new operator. It will become the new object's prototype.

  3. Adding custom properties to a function - Stack Overflow

    Dec 21, 2011 · Adding your own custom properties to a function can be done in different ways that should work in every browser. Way 1 : adding properties while running the function : doSomething.name = 'Tom'; doSomething.name2 = 'John'; return 'Beep'; Way 1 (alternate syntax) : doSomething.name = 'Tom'; doSomething.name2 = 'John'; return 'Beep';

  4. Properties of Javascript function objects - Stack Overflow

    Mar 2, 2013 · Functions are objects in JS, just like Object literals, arrays, or anything else: a function can be assigned properties and methods at will: console.log(this); console.log(this === someAnonFunction);//will be false most of the time. console.log(this === someAnonFunction);//will be true most of the time.

  5. JavaScript Functions - W3Schools

    A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses (). Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).

  6. javascript - Accessing function object's properties from inside …

    Jan 11, 2015 · Functions in javascript is also an object and can have properties. So is there any way to access its properties from inside its own function body? like this. console.log(/*some way to access f.a*/); Well, your example uses a reference, so you get the answers accordingly. Still looking for an answer.

  7. JavaScript Function Definitions - W3Schools

    JavaScript functions have both properties and methods. The arguments.length property returns the number of arguments received when the function was invoked: The toString() method returns the function as a string: A function defined as the property of …

  8. The Ultimate Guide to the JavaScript Function Type

    All functions are instances of the Function type, which are the objects that have properties and methods. A function has two important properties: length and prototype. A function also has three important methods: call(), apply(), and bind().

  9. JavaScript Function Complete Reference - GeeksforGeeks

    6 days ago · JavaScript Functions Properties: Return the number of parameters required by a function. Set the display name of the function. Returns the function that invoked the specified function. Return the name of the function. It is different from the function call () because it takes arguments as an array.

  10. Function object, NFE - The Modern JavaScript Tutorial

    Apr 6, 2025 · In JavaScript, functions are objects. A good way to imagine functions is as callable “action objects”. We can not only call them, but also treat them as objects: add/remove properties, pass by reference etc. Function objects contain some useable properties. For instance, a function’s name is accessible as the “name” property:

  11. Some results have been removed