Skip to content

How to convert each item in array #1535

Discussion options

You must be logged in to vote

I had task like this in my app, and it was resolved by _array.reduce function
My datastructure:

[
  {
    "Backend_name": "Test Group",
    "CPU_usage": "4",
    "HDD_usage": "59",
    "Hostname": "host1",
    "IP": "10.10.245.201",
    "RAM_usage": "50",
    "Sessions_count": 0,
    "State": "online",
    "Status": "online",
    "selected": false
  },
  {
    "Backend_name": "Test Group",
    "CPU_usage": "25",
    "HDD_usage": "59",
    "Hostname": "host2",
    "IP": "10.10.245.202",
    "RAM_usage": "82",
    "Sessions_count": 1,
    "State": "maint",
    "Status": "online",
    "selected": false
  },
  {
    "Backend_name": "Test Group",
    "CPU_usage": "8",
    "HDD_usage": "59",
  …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kemeris2000
Comment options

Answer selected by kemeris2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants