I am trying to copy an array into an array in object. I am getting this error
Type 'any[]' is not assignable to type '[]'.
Target allows only 0 element(s) but source may have more.
My object is
newForm: {formName: string, formId: string, formAttributes:[], formResponses:[]};
I am copying this array-
formAttributeValues=["firstname", "lastname"]
as follows:
this.newForm.formAttributes= [...this.formAttributeValues];
This doesn't work. How can I solve this?