Function Definition Vs Function Declaration
Hi, am a passionate programmer and front-end web developer I am interested in problem solving
Function Declaration
Function Declaration is a practice in which a function is created with a function keyword and can be called before the actual function is being written.
//function declaration
myFunction();
function myFunction(){
console.log("Function declaration")
}
Function Definition
Function definition is a practice in which a function is created and is assigned to a variable. The function created so can only be called once after it is being assigned to a variable. It is also called as function expressions.
const assignedVariable = function myFunction(){
console.log("Function Definition")
}
assingnedVariable()