我有一些簡單的jQuery代碼:javascript/jQuery數組串聯?
var response = Array()
$('.task-list').each(function() {
response.concat(response,$('#' + this.id).sortable('toArray'));
}
);
console.log(response);
我遇到的問題是,我想我使用CONCAT improperly-的結果是一個空數組。當我使用數組推送時,它可以正常工作。
什麼是你想完成的任務。你想要添加元素到jQuery對象嗎? –