Skip to content

Instantly share code, notes, and snippets.

@michaelenglo
Last active June 13, 2020 01:05
Show Gist options
  • Save michaelenglo/dc01ece21b8301408c96c7cdeeac1423 to your computer and use it in GitHub Desktop.
Save michaelenglo/dc01ece21b8301408c96c7cdeeac1423 to your computer and use it in GitHub Desktop.
What does this JS code evaluate to?
const noOfShownComments = 5;
const commentsIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
console.log(!!(noOfShownComments => commentsIds.length
? true
: false}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment