0
function multNmbrs(a, b) { var c = a*b; } multNmbrs(2, 6);
hello all! can someone explain to me, why this code gives nothing?
5 Respuestas
+ 6
First of all you are not doing anything like console.log and second is you are returning nothing out of this function,
And if you are just trying to find the multiplication of these numbers there is no need of declaration of variable c inside your function you can just put return a*b
And here is a improved version of your code
function multNmbrs(a,b){
return a*b;
}
console.log(multNmbrs (2,6));
+ 1
answer is nothing
+ 1
nothing
+ 1
nothing
0
The answer is nothing, because it is not returning anything.