+ 1

*SOLVED* Can't get JavaScript to recognize variations

Started learning JavaScript two days ago. I've been trying to make simple mathematical function but JavaScript won't recognize variations given from prompts. https://code.sololearn.com/WTO4Rs03yViU/?ref=app

10th May 2017, 5:11 AM
flow
flow - avatar
2 Answers
+ 2
Instead of local variables, declare the a and b variable as global
10th May 2017, 3:46 AM
CalviŐ˛
CalviŐ˛ - avatar
+ 4
addNum function doesn't know about variable a or b. either do what Calvin said or return a and b from top function get store it on addNum function
10th May 2017, 5:59 AM
Apel Mahmod
Apel Mahmod - avatar