Ask Question
27 September, 20:26

var shirt = "blue"; 2. var pants = "gray"; 3. var clothes = wearIt (shirt, pants); 4. function wearIt (x, y) 5. { 6. var myOutfit = "Today I will wear a " + pants + 8 " shirt and " + shirt + " pants."; 7. return myOutfit; 8. } 9. document. write (clothes); What are the arguments and parameters in the code snipped?

+1
Answers (1)
  1. 27 September, 22:07
    0
    Arguments: "blue" and "gray"

    Parameters: x and y

    Explanation:

    In programming, a function can take zero or one or more than one input values. These input value will be held by the variables which are called parameters. In this code snippet, x and y are parameters of wearIt function.

    On another hand, when calling a function, we provide the values to the function and the values provided are termed as arguments. In this case, we provide the string blue and gray which are held by shirt and pants variables respectively to the function wearIt. The string "blue" and "gray" will then be passed to parameter x and y which will be processed in the function.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “var shirt = "blue"; 2. var pants = "gray"; 3. var clothes = wearIt (shirt, pants); 4. function wearIt (x, y) 5. { 6. var myOutfit = "Today ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers