If vs Logical and

Edit on GitHub

Setup

var comp = 596

Tests

  • If

    if(comp < 0) {
        "do the thing"
    }
  • Logical and

    comp < 0 && "do the thing"