79362928

Date: 2025-01-16 20:06:06
Score: 1
Natty:
Report link

What you are trying to do is push an object but instead only pushing an array.

Correct implementation:

let Loads = []
let load = [
  {
    "Depositorcode":"VEN02"
  },
  {
    "Depositorcode":"BAS18"
  }
]
Loads.push({load: load})
console.log(Loads)

Your implementation is simply adding more data to the array, as if you were doing:

let data = ['foo']
data.push('bar')
//data = ['foo', 'bar']
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What you are
  • Low reputation (1):
Posted by: Jacques Rossouw