title: Ternary Operators in Scala
body: <p>I would like to simplify this: </p>
  
  <pre><code>var countA: Int = 0
  var countB: Int = 0
  
  if (validItem) {
    if (region.equalsIgnoreCase( "US" )) {
      if (itemList &gt; 0) {
        countB = 1
      } else {
        countA = 1
      }
    } else {
      countB = 1
    }
  } else {
    countA = 1
  }
  </code></pre>
  
  <p>How do I use ternary operator in scala. </p>