createCustomer(customer: Customer): void {
this.customersRef.add({...customer});
}
I saw this code in the Angular tutorial for firebase. What do these three dots mean? I know either they are used as a spread or rest operator but why it is used here?
And the second question is there any shorter anonymous way by which I can send my interface object by changing only one of its properties?
Example
export interface Person{
name:string;
age:number;
role:string;
}
While saving data in firebase I just get the name and age but the role property is decided at the runtime before adding the record, so is there any easy way where I can just change the role property before submitting the interface values?