I have a set of elements "inputData" , and it appears as follows :
[{code:"11" , name= "test1" , state:"active" , flag:"stat"},
{code:"145" , name= "test2" , state:"inactive" , flag:"pass"},
{code1:"785" , name= "test3" , state:"active" , flag:"stat"},
...
]
Instead of using loops, I aim to filter it in order to get an outputData array that looks like this :
[{id:"11" , libelle= "test1"},
{id:"145" , libelle= "test2"},
{id:"785" , libelle= "test3"},
...
]
where
code -> id
and
name -> libelle
Any ideas for this?