(Shamelessly stolen from reddit)

  • MightBeFluffy@pawb.social
    link
    fedilink
    English
    arrow-up
    20
    ·
    edit-2
    3 days ago

    A ternary is a short hand to assign a value based on a true/false statement

    let a; if(isTtrue) a=2 else a=9

    Becomes

    let a = (isTrue) ? 2 : 9