title: How to simplify multiple if statements javascript?
body: <p>I have multiple conditions to check. I have to add icons based on the conditions, Then I need to change the background color based on some other set of conditions. I am using if statement. This is my code. </p>
  
  <p>JSON:</p>
  
  <pre><code>{
    "date": "2017-05-12",  
    "a": false,
    "b": true,
    "c": true,  
    "d": false,
    "status": "active"
  }
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code> if (date != -1) {
    //do something
    if (a) {
      //Add icon a
    }
    if (b) {
      //Add icon b
    }
    if (c) {
      //Add icon c
    }
    if (d) {
      //Add icon d
    }
  }
  
  if(status == "active"){
    //Background Green
  }
  else if (status == "onhold"){
    //Background Yellow
  }
  else if (status == "inactive"){
    //Background Red
  }
  else{
    //Backgeound Grey
  }
  </code></pre>
  
  <p>How do I simplify it?</p>