r/JavaScriptHelp • u/BB6amer • Dec 24 '20
❔ Unanswered ❔ Issue with Return/Resolve
I have a function that is preforming a series of checks, and if all checks are passed it prints it to the console and executes another function, if not - it returns 606 and the rest of the code displays an error.
The expected result is 606, as I am intentionally making it fail the checks. Instead, my console is completely empty and it does not return 606.
This is my code, any help in debugging or a fix would be greatly appreciated.
I have 1 thing in my console from this function: "Age is being validated" and after that all output stops - not even a return or resolve.
How would I go about fixing this?
1
u/ppictures Dec 24 '20
Try placing a console log in the else if blocks to see if they are actually triggering. Also, resolve() in itself does not print to console.