我正在开发Angular 4应用程序。Typescript中这两个数组赋值有什么区别?
我在我的应用程序中找到了下面的代码,但无法找到下面代码的确切目的。
getManagementView(groupField: string) {
this.auditList = [...this.auditList.filter(this.filterByRevisit)];
}
我改变它为下面的代码都工作正常。
getManagementView(groupField: string) {
this.auditList = this.auditList.filter(this.filterByRevisit);
}
任何人都可以帮助我理解上述两个代码块有什么区别。
在我看来,有些人爱上了'...'运营商和滥用了很多。 – deceze
标题中的问题与描述中的问题不同。 – trincot