title: Javascript: Grab value before and after specific value in array
body: <p>I'm trying to grab the value before and after a specific array value.</p>
  
  <p>Like this</p>
  
  <pre><code>var arr = ["model", "color", "handle", "front", "extras"];
  var category = "color";
  
  for(i in array) {
    if(array[i] == category {
    //grab in this case model and handle
    }
  }
  </code></pre>
  
  <p>I have tried a number of things such as: adding keys to the array, forcing the array to an object, but nothing helps..</p>
  
  <p>Thanks in advance</p>