+ 1
How to modify data and make in different format of data in javascript?
Example - data=[ { "1":{ "101":[{name:'user',ip:[{date:101,ip:12345.12345.12345}], "192":[{name:'user',ip:[{date:192,ip:12345.12345.12345}], "123":[{name:'user',ip:[{date:123,ip:12345.12345.12345}] }, "12":{ "101":[{name:'user',ip:[{date:101,ip:12345.12345.12345}], "192":[{name:'user',ip:[{date:192,ip:12345.12345.12345}], "123":[{name:'user',ip:[{date:123,ip:12345.12345.12345}] } }] I need output data as below Output = [{name:'user',ip:[1234.2334,1234.4665]},{name:'user',ip:[1234.2334,1234.4665]},{name:'user',ip:[1234.2334,1234.4665]}]
4 Réponses
+ 3
There are many possible ways I can imagine to do this transformation. Your question is not specific enough. And make no mistake, I will not write the code for you, but I can help you solve it.
Can you explain with your own words, what are the steps to reach this result?
It is not apparent what happens with the ID 1, 12, 101, 192 and 123. All the details in the "ip" field look the same, and 12345.12345.12345 is not even valid javascript syntax (it is not a number and not a string, plus it is also not a valid Internet Protocol address).
0
Please solve anyone if you are able to do this.
0
This is example data not exactly data
0
Ip May be same or different