Open links in new tab
    • Work Report
    • Email
    • Rewrite
    • Speech
    • Title Generator
    • Smart Reply
    • Poem
    • Essay
    • Joke
    • Instagram Post
    • X Post
    • Facebook Post
    • Story
    • Cover Letter
    • Resume
    • Job Description
    • Recommendation Letter
    • Resignation Letter
    • Invitation Letter
    • Greeting Message
    • Try more templates
  1. In JavaScript, you can access all arguments passed to a function — even if they are not explicitly listed as parameters — using the arguments object or rest parameters (...args).

    Example using arguments object:

    function logArguments(a, b) {
    console.log("First argument:", arguments[0]);
    console.log("Second argument:", arguments[1]);
    console.log("Total arguments passed:", arguments.length);
    }

    logArguments(10, 20, 30);
    // Output:
    // First argument: 10
    // Second argument: 20
    // Total arguments passed: 3
    Copied!

    Here, arguments is an array-like object available inside all non-arrow functions. It contains indexed values of all passed arguments and a length property, but lacks array methods like .map() or .forEach() unless converted to a real array.

    Example using Rest Parameters (...args):

    Feedback
  2. The arguments object - JavaScript | MDN - MDN Web Docs

    arguments is an array-like object accessible inside functions that contains the values of the arguments passed to that function.
    Description

    The arguments object is a local variable available within all non-arrow functions. You can refer to a function's arguments inside that function by using its arguments object. It has entries for each argument the function was called with, with the first entr…

    Properties

    arguments.callee Deprecated
    Reference to the currently executing function that the arguments belong to. Forbidden in strict mode.
    arguments.length
    The number of arguments that were pass…

    Examples

    Defining a function that concatenates several strings
    This example defines a function that concatenates several strings. The function's only formal argument is a string containing the characters that separate th…

    Browser compatibility

    BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

  3. JavaScript Function Parameters - W3Schools

    Learn how to use parameters, arguments, default values, rest parameters, and the arguments object in JavaScript functions. See examples, rules, and explanations with code snippets.

  4. Argument Object in JavaScript - GeeksforGeeks

    Jan 16, 2026 · The arguments object is a built-in, function-local object in JavaScript that stores all values passed to a function call. It behaves like an array and allows access to parameters by index, even …

  5. What is the arguments Object? - freeCodeCamp.org

    JavaScript automatically blocks method calls on the arguments object for performance reasons. The includes or push methods unreliably work on the arguments object so those methods should be …

  6. Arguments object - JavaScript | MDN

    Jun 27, 2017 · You can use the arguments object if you call a function with more arguments than it is formally declared to accept. This technique is useful for functions that can be passed a variable …

  7. Understanding the arguments Object in JavaScript - DEV …

    Oct 1, 2024 · The arguments object is a powerful yet simple mechanism in JavaScript, enabling flexible function behavior, particularly when working with …

  8. People also ask
    Loading
    Unable to load answer
  9. Arguments object - JavaScript | MDN - Mozilla Developer Network

    You can refer to a function's arguments within the function by using the arguments object. This object contains an entry for each argument passed to the function, the first entry's index starting at 0.

  10. JavaScript Arguments Object - TutorialsTeacher.com

    The arguments object is an array-like object. You can access its values using an index similar to an array. However, it does not support array methods. The arguments object is still valid even if a …

  11. What are Arguments in a Function - GeeksforGeeks

    Jul 23, 2025 · Arguments in JavaScript functions are the input values passed to the function when it is called. Functions can accept zero or more arguments, which …

  12. How to use JavaScript Arguments? [SOLVED]

    Jan 7, 2023 · Function arguments are an important part of JavaScript programming, as they allow you to pass values to functions and perform …