草庐IT

guestPush

全部标签

javascript - typescript 推送到数组中的特定键

我正在使用Firebase开发Angular2项目。我需要在this.guestPush中将所有查询结果推送到同一个键下。我有一个包含不同用户级别的多选元素。4、6、9。Whenonelevelisselected,theresultingobjectissavedintheguestPusharray,butwhenanotherlevelisselectedthefollowingerroroccurs.我收到这个错误:ERRORTypeError:this.guestPush[("filter"+i)].pushisnotafunction这是我的代码:guestPush:any