For example i have an object with key 1:

```
1:{{name:alice,surname:doe}}

```

i have another object with same key 1:

```
1:"A"

```

By iterating we check if both keys are matching ( in this case 1 and 1 ) so we add second objects A to first object as grade:A so final object looks like 

```
1:{{name:alice,surname:doe,grade:A}}

```

I am adding a picture to explain better.

[![enter image description here](https://i.stack.imgur.com/lKpKB.png)](https://i.stack.imgur.com/lKpKB.png)

this is what i have tried: the problem is 00001 key is missing:

```
    Object.keys(localallcourseobject).forEach(function(key){
  if(key in passedcoursesgrade) {
    var c = Object.assign(localallcourseobject[key],{grade:passedcoursesgrade[key]});

   console.log(c);

  }
});

```

[enter image description here](https://i.stack.imgur.com/Titm4.png)