Hello i am a beginner in JAVASCRIPT and i want to learn more about functions with parameters; i have problem in the second case the console write that sayhello it is not a function ( how can i fix this letter code please)
var gender = prompt('are you mr or ms')
if (gender === 'mr') {
function sayhello(name, gender) {
return ('hello' + gender + name + ' how are you today')
}
console.log(sayhello(' mike', " mr "))
} else {
console.log(sayhello(' emmy', " ms "))
}