I'm attempting to transfer the contents of one array into an array within an object, but I keep encountering this error:
Type 'any[]' is not assignable to type '[]'.
Target allows only 0 element(s) but source may have more.
Here's my object structure:
newForm: {formName: string, formId: string, formAttributes:[], formResponses:[]};
The array I want to copy is:
formAttributeValues=["firstname", "lastname"]
To copy it, I tried:
this.newForm.formAttributes= [...this.formAttributeValues];
Unfortunately, that didn't work. Any ideas on how to resolve this issue?