JAVASCRIPT FUNCTION :is the way of performing various task by specifying a structured javascript program and also declaring a meaningful synthax inorder to give out put
DECLARING FUNCTION: happen after a specification and discriptive syntax where you can provide the returning values or names due to the function has made
eg: function name(){
console.log("michael")}
CALLING FUNCTION:this used when we need to specify a function name or data value inorder expect the returning
eg:function name(){
console.log("michael")}
name();
FUNCTION PARAMETERS: this happen when in getting return or what to receiceve in function you have to set a parameter name value to identify the value to pass through
eg:function sale(name) {
console.log("type car = " + name + ":)");
}
let name = (" benz ");
sale(name);
ADD TWO NUMBERS:this when your function has two parameters(a,b)to passed though and various agreement which are use to call function where console.log determine
which operators we can use to get our returns
function number(a,b) {
console.log(a + b);
}
number(3,9);
number(8,51)
FUNCTION RETURN: when you make a function call and this is used to retuns the values and when nothing to return its shows undefined
function number(a,b){
return a+b;}
let number1 =8;
let number2 =7.8;
let sum = number(number1,number2);
console.log("sum equal to" + result)
Top comments (0)