I can't reproduce the error you are getting. My JS engines log:
SyntaxError: Identifier 'loginUser' has already been declared
Your function declaration declares a variable named loginUser
.
Your const
declaration declares a variable name loginUser
.
const
can't redeclare a variable that already exists in the same scope, hence the error.
Your error message, which seems to be an oddity of your environment, is saying that since you have just said const loginUser
you can't read the value loginUser
to assign to it because the new one doesn't exist yet.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…