+ 3
What is a parameter
i just find a question that states "write a java script function that accept string as a parameter---" and i dont understand what a parameter means.
13 ответов
+ 5
a parameter is something which is ‘passed into’ a function or method
and goes within the two brackets ().
the information you type into the parameter which is everything within the brackets are called arguments
+ 10
Hello, Kelzbiggie !
Often we need to repeat the same action in many parts of the program.
For example, it is nice to display a message when the visitor is greeting, when the visitor leaves the site, somewhere else.
In order not to repeat the same code in many places, functions are invented. Functions are the main "building blocks" of the program.
Examples of built-in functions you already saw are alert (message), prompt (message, default), and confirm (question). But you can also create your own https://www.sololearn.com/learn/JavaScript/1146/?ref=app
+ 5
Programmers use parameter and argument interchangeably, so heads up with that info.
+ 2
thank you guys🙏
+ 2
np
+ 2
Suppose
//define function to accept parameter as name of person and display it.
function display_name(name)
{
alert(name) ;
}
//call the function to display name
var uname = "ajay"
display_name(uname) ;
In above example we call a function by specifying some parameters in round bracket. There might be no parameters to functuon. But this is how you can pass parameters to functions.
+ 1
Great question! Even I don’t know what a parameter is!
+ 1
just a something which pass to the method
+ 1
its just a variable or we can call it aargument
+ 1
parameters are multiple arguments
+ 1
a parameter is a
special kind of variable, used in a subroutine to
refer to one of the pieces of data provided as input
to the subroutine.
0
a parameter is not a fixed quantity but it depends on some conditions, its like a variable.
0
we need to pass arguments to activate a function that is to call the function.. in order to do that.. we should mention the parameters according to the prototype of the function