0

I have a JSON data something like:

'1': 
  { code: '1',
    type: 'car',
  },
 '2': 
  { code: '2',
    type: 'bike'
  },
  ...

I dont want to parse 1 and 2 in the parent. Only I need to have

  [{code: '1',
    type: 'car',
  }, 
  { code: '2',
    type: 'bike'
  },
  ...]

How can I do that?

1 Answer 1

2
jsonArray = [];
for (var i in JsonData) {
  jsonArray.push(jsonData[i]);
}
Sign up to request clarification or add additional context in comments.

1 Comment

There is nothing like for(var in ...) in NodeJS. Are there?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.