What is a parameter | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

26th Jun 2018, 4:37 PM
Kelzbiggie
Kelzbiggie - avatar
13 Answers
+ 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
26th Jun 2018, 4:39 PM
Agent
Agent - avatar
+ 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
26th Jun 2018, 4:40 PM
Alexander Sokolov
Alexander Sokolov - avatar
+ 5
Programmers use parameter and argument interchangeably, so heads up with that info.
28th Jun 2018, 4:59 AM
Saul
Saul  - avatar
+ 2
thank you guys🙏
26th Jun 2018, 4:44 PM
Kelzbiggie
Kelzbiggie - avatar
+ 2
np
26th Jun 2018, 4:44 PM
Agent
Agent - avatar
+ 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.
9th Sep 2018, 7:31 AM
Ajay Tambe
Ajay Tambe - avatar
+ 1
Great question! Even I don’t know what a parameter is!
9th Sep 2018, 6:41 AM
Ardi Tse
Ardi Tse - avatar
+ 1
just a something which pass to the method
9th Sep 2018, 8:25 AM
Nikhil Chaudhari
Nikhil Chaudhari - avatar
+ 1
its just a variable or we can call it aargument
9th Sep 2018, 10:13 AM
Kalpana Kandel
Kalpana Kandel - avatar
+ 1
parameters are multiple arguments
9th Sep 2018, 11:03 AM
Michael Okolie
Michael Okolie - avatar
+ 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.
9th Sep 2018, 9:17 PM
Ryan Matsangaise
Ryan Matsangaise - avatar
0
a parameter is not a fixed quantity but it depends on some conditions, its like a variable.
9th Sep 2018, 5:34 AM
Alpesh_Jamgade
Alpesh_Jamgade - avatar
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
9th Sep 2018, 3:26 PM
Lasya Sharma Nuthi
Lasya Sharma Nuthi - avatar