Ask Question

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. 24 January, 09:59
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers