I'm trying to grab the value before and after a specific array value.
Like this
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
}
}
I have tried a number of things such as: adding keys to the array, forcing the array to an object, but nothing helps..
Thanks in advance