1336 links
  • linx
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
  • ► Play Videos
Links per page: 20 50 100
page 1 / 1
1 results tagged conditional x
  • thumbnail
    Nested Ternaries are Great – JavaScript Scene – Medium

    The truth is, ternaries are usually much simpler than if statements. People believe the reverse for two reasons:

    • They’re more familiar with if statements. Familiarity bias can lead us to believe things that aren’t true, even when we’re presented with evidence to the contrary.
    • People try to use ternary statements as if they’re if statements. That doesn’t work, because ternary expressions are expressions, not statements.

    Before we get into the details, let’s define a ternary expression:

    A ternary expression is a conditional expression that evaluates to a value. It consists of a conditional, a truthy clause (the value to produce if the conditional evaluates to a truthy value), and a falsy clause (the value to produce if the conditional evaluates to a falsy value).

    January 29, 2018 at 9:34:43 AM UTC * - permalink -
    QRCode
    - https://medium.com/javascript-scene/nested-ternaries-are-great-361bddd0f340
    conditional expression javascript js-ecosystem operators statement ternary
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation