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

[Question] What does this line mean? #186

Closed
erfanium opened this issue Apr 16, 2021 · 3 comments · Fixed by #187
Closed

[Question] What does this line mean? #186

erfanium opened this issue Apr 16, 2021 · 3 comments · Fixed by #187

Comments

@erfanium
Copy link
Contributor

While I was creating a Deno port of this project, I saw this line:

this.hasConstraints = false || options.hasConstraints

What's the point of false || ...? The first condition is always false!

@erfanium erfanium changed the title [Question] What this line means? [Question] What does this line means? Apr 16, 2021
@erfanium erfanium changed the title [Question] What does this line means? [Question] What does this line mean? Apr 16, 2021
@mcollina
Copy link
Collaborator

It sets thee default value to false.

@erfanium
Copy link
Contributor Author

erfanium commented Apr 17, 2021

It should be this.hasConstraints = options.hasConstraints || false to set the default value to false.
this.hasConstraints = false || options.hasConstraints is no different from this.hasConstraints = options.hasConstraints.
unknown
I'll create a PR for this.

erfanium added a commit to erfanium/find-my-way-deno that referenced this issue Apr 17, 2021
@erfanium erfanium mentioned this issue Apr 17, 2021
mcollina pushed a commit that referenced this issue Apr 17, 2021
@mcollina
Copy link
Collaborator

thanks!

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

Successfully merging a pull request may close this issue.

2 participants