Proposed change to // falsy section.
Closed this issue · 6 comments
Due to my confusion on issue #19, I'm proposing a change to the formatting of this section. I completely understand what @gaand was going for when he wrote it, but think there might be a better way to present this information to developers. Here is my suggestion, though of course I am open to something else.
The falsy list (everything else in JavaScript is truthy),
false
undefined
null
0
and-0
NaN
''
and""
aka the empty string
I'm ok with this.
Is it clear (to the consultant so they can make clear to the developers) that
"" === ''
// => true
// and
0 === -0
// => true
?
If you both think the and
above captures that for whomever might deliver this material, then I'm okay with it as well.
I think it's clear that "" === '' and 0 === -0, but it's worth explicitly mentioning. Feel free to add a note if you'd like! I think that's a different issue, but I agree it's a good talking point. To the original point, I think using the github formatting resolves the confusion I had while reading it.
Can be closed with #24 - fixed in latest merge from 013/master branch into master.
@laurenfazah this wasn't actually resolved IMO. Please see my comment above for formatting. It's more an issue of formatting than anything. The 0 //and -0
is confusing to devs.
I asked @payne-chris-r to re-open this. It was confusing to our developers in 014. I think, if we want to show comments as part of this lesson, we should do it in a separate section.
Also, to me, these heuristics make sense:
- If you're in a fenced code block,
//
and/* */
make sense, with//
preferred. - If you're in an inline code snippet, prefer to use English outside the code snippet and code inside. That is, no comments in inline code snippets.
OK:
0 // and -0
// OR
0 /* and -0 */
OK: 0
and -0
NOT OK: 0 // and -0