+ 1
Why is this incorrect
function myFunction(a, b) { var x= return a * b; } myFunction(5, 6); document.write(x);
3 Answers
+ 8
this is js..you do not say int a,int b..
thats wrong harsh agrawal.
The error is with...
var x=return a*b
you cannot assign a return statement directly to a variable
right syntax is:
function myFunction(a, b) {
return a * b;
}
var x=myFunction(5, 6);
document.write(x);
+ 2
đłđŹBrains ya i think u r right i dont know much about js
Sorry for wrong informationđ˘đ˘
+ 1
take d data types in formal parameter as like dis (int a,int b) n u cant return with any variable so plzzzz dont take any variable just write return a*b;