Tell us what’s happening:
My question is regarding the modules Passing Values to Functions with Arguments and Return a Value from a Function with Return.
As I understand it, we’re doing almost a similar thing in both modules which is computing numbers. Then why do we need to write console.logs() in when using Arguments but not when using the Return function? Why are their formats so different?
Just trying to understand if my logic is a bit incorrect. Thank you for helping
Your code so far
function functionWithArgs(arg1,arg2){
console.log(arg1+arg2);
}
functionWithArgs(8,2); //Outputs 10
functionWithArgs(12,3); //Outputs 15
function timesFive(num){
return num*5;
}
const answer=timesFive(10); // Outputs 50
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Return a Value from a Function with Return
Link to the challenge: