.push() multiple objects into JavaScript array returns 'undefined'

前端 未结 3 1419
慢半拍i
慢半拍i 2021-02-07 04:54

When I add items to the beats array and then console.log the User, I\'m getting the correct number of items in the array. But when I check .length, I always get 1. Trying to ca

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 05:06

    addBeats() should concat this.beats with the beats parameter.

提交回复
热议问题