function (examples)

PHOTO EMBED

Tue Nov 02 2021 17:11:44 GMT+0000 (Coordinated Universal Time)

Saved by @bronxrock

/*
function functionName(parameter1, parameter2, parameter3) {
  body code goes here
}
Functions are "called" by entering function's name followed by invocation operator, (). "Invoke"/"execute" mean the same thing. Arguments that the function declaration expects should be passed inside of the invocation operator. Functions can, but are not obligated to, return return values at the end of their execution. Return values are often results of a process, grand totals, or success / failure data.
*/

function sayHi(name){
  console.log('Hello '+ name)
}
// sayHi('Ash')

const hiRose = function(){
  console.log('Hi Rose')
}
// hiRose()

const doMath = function(number, number2){
  return number * number2
}

let fiveByFive = doMath(5,5)

/* 	> fiveByFive
	> 25
    >
*/    
content_copyCOPY