Ask Question
23 September, 15:19

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?

+2
Answers (1)
  1. 23 September, 15:26
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers