N
N
Nikolay Semenov2017-10-08 12:50:12
JavaScript
Nikolay Semenov, 2017-10-08 12:50:12

How to match the fields of two objects?

Guys hello everyone.
Tell me how to reassign the fields of one object to the corresponding fields of another?
The fact is that I want to create a universal react component for rendering progressbars, it accepts data like this

const nameUnit = {
    1: {
         barName: 'test1',
         barValue: 57
       },
       2: {
         barName: 'test2',
         barValue: 90
      },

I have an object like this
tags = {
  0: {
     tagId: 'fdsf',
    tagName: 'gdfg',
   totalUsers: 5435,
   tagValue: 98
}
}

how to get an object from these two of this kind
analyticData = {
  0: {
     tagId: 'fdsf',
    barName: 'gdfg',
   totalUsers: 5435,
   barValue: 98
}
}

?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question