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
  • 155,085
  • 27
  • 166
  • 222
gs4982
  • 9
  • 2

0 Answers0