FUNCTION PARAMETER/ types of parameter
FUNCTION PARAMETER:-
-parameter is special types of data used inside function().
Ex.
function display(A)
-A is called parameter.
Ex.
function show(name,city)
-name,city called parameter.
TYPES OF PARAMETER:-
there are two types of parameters used in function:-
1)receivers parameter
2)senders parameter
1) RECEIVERS PARAMETER:-
- IN this parameters only create at the time of functions creations.
Ex.
function display(Name,city) -(it is called receivers parameter.)
{
}
2) SENDER PARAMETER:-(argument)
-in this parameter only used at the time of function calling inside the onclick event.
Ex.
<button onclick="display(10)"> log in </button>
-((10) called sender parameter)
<html>
<head>
<script language="JavaScript">
function display(roll,name)
{
document.write(roll);
document.write("<br>");
document.write(name);
}
</script>
</head>
<body>
<button onclick="display(101,'ramesh')"> log in </button>
</body>
</html>
Comments
Post a Comment