Skip to content

JavaScript Arguments Object | Example code

  • by

JavaScript Arguments Object contains the values of the arguments passed to that function. This is an Array-like object accessible inside functions that have the values of the arguments passed to that function.

function func1(a, b, c) {


func1(1, 2, 3);

JavaScript Arguments Object

Simple example code.

<!DOCTYPE html>

    function test(a, b, c) {
      console.log("Printing arguments: ", arguments[0], arguments[1], arguments[2]);



JavaScript Arguments Object

Length property that contains the number of arguments passed to the function.

function test(a, b, c) {
test(1); // 1
test(1, 2); // 2

Use many parameters in the function declaration.

function test() {

test();  //0
test(1);  //1
test(1,2,3,5);  //4

Do comment if you have any doubts or suggestions on this Js object topic.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Your email address will not be published. Required fields are marked *