Question: I've two objects, one with fruit colors:

```
fruitColor = {
    'color': "Yellow",
    'fruits': []
}

```

And the second with fruits:

```
fruits = {
    'title': "Banana",
    'color': "Yellow"
}

```

How can I match the both .color (and add/push fruits to fruitColor.fruits) in a simple way? Both colors and fruits contains multiple.

I've tried jQuery .map() and .each() but not sure how to use it in this example.

Answer: 
```
$.each(fruits,function(i,v){
   $.each(fruitColor,function(i2,v2){
      if (v.color == v2.color)
        v2.fruits.push(v.title);
   });
});

```
Your objects it self are json objects you can simly compare them by gettinf `Object.property` value.

check this [fiddle](http://jsfiddle.net/3sLmopd9/1/)

```
fruitColor = {
    'color': "Yellow",
    'fruits': []
}

fruits = {
    'title': "Banana",
    'color': "Yellow"
}

$(document).ready(function(){

 if(   fruitColor.color == fruits.color){
 fruitColor.fruits.push(fruits);

 }

    console.log( fruitColor.fruits);

});

```