function findNeighbors(color_indices) {
var neighbor_face = [];
var temp_indexes = [];
//initializing to specified length
var len_color_indices = color_indices.length;
for (var i = 0; i < len_color_indices; i++) {
if (color_indices[i] % 2 == 0 ) {
if (color_indices[i] % 10 == 8) {
temp_indexes[0] = (color_indices[i]) + 1;
temp_indexes[1] = (color_indices[i]) - 17;
temp_indexes[2] = (color_indices[i]) - 19;
//check if it is in the array
for (var k = 0; k < 3; k++){
if ($.inArray(temp_indexes[k],color_indices) != -1){
color_indices.push(temp_indexes[k]);
}
}
The input : color_indices is expected as an array from a global variable. I want to add only new values from temp_indexes to the color_indices array. Tried using $.inArray but it's not working as desired. Any suggestions?
Thanks!