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 .