Why function deceleration overrides

kambala yashwanth - Nov 30 '18 - - Dev Community

var myName = "Richard"; 

function myName () {
console.log ("Rich");
}

console.log(typeof myName)

////output is string

but when i code function in other way like in above code, giving different output

var myName = "Richard"; 

myName = function() {
console.log ("Rich");
}

console.log(typeof myName)

////output is  function


. . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player