Undefined


#1

Hi
Why I get undefined in console.log
let eightball=funk=>{funk=Math.floor(Math.random()*7)
switch (funk) {
case 0: return (‘tu asilas 0’)
case 1: return ‘tu asilas 1’
case 2: return ‘tu asilas 2’
case 3: return ‘tu asilas 3’
case 4: return ‘tu asilas 4’
case 5: return ‘tu asilas 5’
case 6: return ‘tu asilas 6’
case 7: return ‘tu asilas 7’
} }
let question=‘Ar as klystu?’
let answeris=(m)=>{m=console.log('Your question is: ‘+question+’ Your answer is: '+eightball()) }

console.log(answeris())


#2

Remove m= so it is not an assignment but an expression.


#3

you’re console.log–ing a function which itself is doing console.log.

the answeris()… self-explanatory… :wink:


#4

Thank you :+1::+1::+1: