Tell us what’s happening:
created the code shown below- it SHOULD work but am getting an error in the console of “afterState is undefined” . I have no idea what or where afterState is? This is in Firefox.
In Chrome I get "cannot read property ‘login’ of undefined.
I even checked against the hint given…
Just to clarify, this is not invalid syntax, it is completely valid, and it being valid is why you are getting the error.
// this is valid, the JS interpreter sees
// the new line, interprets as end of return
// statement, and inserts a semicolon:
// which means it becomes
// The next next few lines are valid JS,
// just irrelevant because the `return` has
// has already happened:
return on its own is completely valid (and semicolons are optional in JS), so you’re just telling the function to return undefined. Do not break to a new line after a return keyword if you want to actually return some value, it will never work.