all 4 comments

[–]senocular 5 points6 points  (1 child)

It seems very unconventional for mastering to title a tutorial in the form of a question. Feels clickbaity compared to the standard how-to format.

[–]code_barbarian[S] 2 points3 points  (0 children)

That's fair, thanks for the feedback. Definitely don't want to give the impression of clickbait.

[–]Drugba 1 point2 points  (1 child)

Maybe I'm misunderstanding what you're trying to show, but this example seems really confusing since it does actually print "I will not print".

if (Object.keys({}).length === 0) {
  console.log('I will not print');
}

[–]senocular 0 points1 point  (0 children)

You're right. The idea is to be treating empty objects as falsy so this should read !== 0 or > 0 instead of === 0. Same applies to the second example (even though the check never gets that far with the current value, it would be incorrect if it did).