Concatenating gives wierd results

#1

I have 2 3d arrays
laso:

  1. 0: {item: “audcad”, time: “09-17”, acc_profit: “-3.23”}
  2. 1: {item: “audusd”, time: “10-17”, acc_profit: “-3.29”}
  3. 2: {item: “audnzd”, time: “10-17”, acc_profit: “4.94”}
  4. 3: {item: “audusd”, time: “10-17”, acc_profit: “-2.24”}
  5. 4: {item: “audnzd”, time: “10-17”, acc_profit: “-3.26”}
  6. 5: {item: “audcad”, time: “10-17”, acc_profit: “-1.74”}
  7. 6: {item: “audnzd”, time: “11-17”, acc_profit: “1.81”}
  8. 7: {item: “audusd”, time: “11-17”, acc_profit: “-2.53”}
  9. 8: {item: “audnzd”, time: “11-17”, acc_profit: “-1.72”}
  10. 9: {item: “audcad”, time: “12-17”, acc_profit: “1.46”}
  11. 10: {item: “audcad”, time: “12-17”, acc_profit: “9.62”}
  12. 11: {item: “audusd”, time: “12-17”, acc_profit: “-2.40”}
  13. 12: {item: “audchf”, time: “12-17”, acc_profit: “0.29”}
  14. 13: {item: “audcad”, time: “01-18”, acc_profit: “-1.51”}
  15. 14: {item: “audcad”, time: “02-18”, acc_profit: “1.81”}
  16. 15: {item: “audcad”, time: “02-18”, acc_profit: “-3.37”}
  17. 16: {item: “gbpaud”, time: “03-18”, acc_profit: “0.13”}

and firsto:
{item: “audcad”, time: “07-17”, acc_profit: “0.00”}

these are results of console.log() of them

However
I need to turn them into 1 array where firsto comes before lasto
var datum_l = firsto.concat(lasto);

generates an errormessage:
currency_family_all.php:19 Uncaught TypeError: firsto.concat is not a function

yet, var datum_l = lasto.concat(firsto); works well

why???

#2

firsto is object, not an array.

2 Likes