0

var sing2 = () => {
  console.log("Function Expression")
}

function sing2() {
  console.log("Function Declaration")
}
sing2()

When I run the above function , I got output as Function Expression but when I ran the below code

function sing2() {
  console.log("Function Expression")
}

function sing2() {
  console.log("Function Declaration")
}
sing2()

I got output as Function Declaration can someone help me understand reason behind this .

mplungjan
  • 169,008
  • 28
  • 173
  • 236

0 Answers0