I have an array object that currently appears like this when printed in my console:
[{
}]
However, I would like it to be formatted like this:
{
}
Can anyone guide me on how to reformat it as per my preference? Here is the structure of my documentsArray:
documentsArray = [];
This is what my code looks like:
uploadFile2(files: FileList | null): void {
const file = files.item(0)
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
this.documentsArray.push({documentType: this.form.controls.dokumentType.value, file: reader.result})
console.log(this.documentsArray)
}
}