Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page reloads even if I say I don't wanna make more juice #1

Open
sokopy opened this issue Jan 27, 2021 · 0 comments
Open

Page reloads even if I say I don't wanna make more juice #1

sokopy opened this issue Jan 27, 2021 · 0 comments

Comments

@sokopy
Copy link

sokopy commented Jan 27, 2021

I wanted to stop making juice and even if I type "no" it still reloads. I checked the code and I realized that in the conditional of the line 26 you use only ONE equal sign. When you use only one equal sign means that you want to declare a variable, so it will return undefined. Therefore it doesn't know what to do so it juts reloads. What you can do is add another equal sign so it reads it as an actual conditional and returns a boolean.

Also, when you add the || symbols as a "or" you juts put the string of the response and happens the same: returns undefined. It's like if you write this:

if("yes"){
location.reload()
}

so in order to fix this other bug you have to write:

if(makeMoreJuice == "yes" || makeMoreJuice == "y" /* etc */ ){
location.reload()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant