It might be a super dumb question but I don’t understand how you get an output of 30 in the sum function? Which numbers are you adding up? I was trying to add the total of the sort function + length function which equaled to 27.
When it says arguments, it means the numbers that are between the parentheses(). So, since it passed in 5, 15, 10, you get 5+15+10=30:
sum(5, 10, 15)
^^^^^^^
all of these are parameters
And the job of the sum function is to add all of its parameters together.
Isn't it one parameter-a vector?
No, since you are only passing values into the function (no variables), you need to use c() to create a vector. Yet since the values 5,15,10 are on their own (there is no c():
c(5, 15, 10)#this is a vector of three values
5, 15, 10#these are just three values