Объявить функцию JavaScript
function myFunction(var1, var2) {
return var1 * var2;
}
Wrong Willet
function myFunction(var1, var2) {
return var1 * var2;
}
function name( parameter1 ,parameter 2,..) //name signifies funcname
{
}
var x = myFunction(10, 10); // Function is called, return value will end up in x
function myFunction(a, b) {
return a * b; // Function returns the product of a and b
}
let x = function (num) { return num * num };
console.log(x(4));
function multiply(num1,num2) {
let result = num1 * num2;
return result;
}
function name(parameter1, parameter2, parameter3) {
code to be executed
}