0

In Firebase DB the structure how Array is stored is as follows.

// When we send this
['a', 'b', 'c', 'd', 'e']
// Firebase stores this
{0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e'}

I am reading this data in my Ionic2 project using AngularFire2. I am getting the whole string as {0: 'a', 1: 'b', 2: 'c', 3: 'd', 4: 'e'}. How to take each value in an Array of string.

Tapas Mukherjee
  • 2,088
  • 1
  • 27
  • 66
  • Check answers here http://stackoverflow.com/questions/6857468/converting-a-js-object-to-an-array avoid the jquery solution – Suraj Rao Feb 26 '17 at 05:34
  • Possible duplicate of [Converting a JS object to an array](http://stackoverflow.com/questions/6857468/converting-a-js-object-to-an-array) – Suraj Rao Feb 26 '17 at 05:34
  • https://firebase.googleblog.com/2014/04/best-practices-arrays-in-firebase.html – cartant Feb 26 '17 at 06:26

0 Answers0