0
Why is function i not defined and unexpected end of input and help with more commands
3 Answers
+ 3
Use something else for variable name, don't use 'prompt' as variable name, 'prompt' itself is a method name for getting text input, as you already know.
+ 2
There is a syntax error in the function, so it fails to get defined.
Use indentation, and you will see it clearly. It's all about balancing curly brackets.
+ 2
You can not use reserved words as variables. prompt is reserved.