Skip to content

JavaScript Arguments vs Parameters | Difference

  • by

The simple between JavaScript Arguments vs Parameters is arguments are the actual values and parameters are the aliases for the values that will be passed to the function.

// a, b, and c are the parameters
var foo = function( a, b, c ) {};

// 1, 2, and 3 are the arguments
foo( 1, 2, 3 ); 

Parameters are variables listed as a part of the function definition. Arguments are values passed to the function when it is invoked.

JavaScript arguments vs parameters

Simple example code.

<!DOCTYPE html>
      function fun(x) //x is the parameter 
        console.log("Arguments vs Parameters"); 

    fun(500); //5 is the argument to the function 


JavaScript arguments vs parameters

Do comment if you have any doubts or suggestions on this Js arguments and parameters 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 *