Skip to content
Advertisement

Variable of function always returns undefined

The idea:
I want to return a variable from a function and then output it using console.log().

The problem:
I can’t just use return result because then nothing is returned.
I don`t really know how else to return the variable.

I have already looked at SO posts like this one, however I probably lack suitable understanding to implement this into my code.

The current code

JavaScript

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement