-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Update "Comparison Operators & Equality" in README.md #674
Conversation
The only 'falsy' values in JavaScript are undefined, null, 0, -0, NaN, '', and false. The 'truthy' values are all other values. All objects are truthy. There is nothing both truthy and falsy, or neither truthy nor falsy. It might be good to indicate this somewhere, but I do think that a basic level of understanding of JS is OK to assume. |
I suppose I should have used '==' in my request then. In any event, I didn't write '===' anywhere in the file (commit title, perhaps... but I can't really fix that without committing again. If you'd like me to, I can), so I'll just edit the request. |
|
Really now. Wow, I assume way too much about the way JS logic works. Perhaps I should just write that it will evaluate as true (since that's what will happen in the end if you let the interpreter decide)? |
The most precise way to describe it is with "truthy" and "falsy" imo. |
Does that look better? |
Sure, this looks great! Are you perhaps able to rebase this down to a single commit? |
I think the rebase worked (it created 5820bcd which contains both commits with the proper title), but that empty commit c2ea6c2 snuck its way in when I did git push. Nothing I do locally can touch it even after pull, re-checkout, and even using its hash in the rebase program instead of HEAD~#. git log knows it exists, but git rebase seems to pretend it doesn't. Please tell me if it's a problem. |
@pgeiss try |
Long post about issues caused by forgetting a --force on git push redacted because it was very long |
@pgeiss the easiest is to make a brand new branch, and force push to your |
Got it! I guess all my issues were because I wasn't force pushing. Anyways, should be all set now. |
Sure, but this way I don't have to have a merge commit :-) Thanks! |
The guide should be more clear that [] is truthy because arrays are objects. As is, a reader could be confused about this because an empty string will be evaluated as false and it's possible (but not a good idea) to access a string using array-like syntax. It also doesn't help that this array-like syntax is in line with other languages like C where strings ARE arrays, further adding to potential confusion.