I'm trying to create a multi-dimensional array but for some reason only the last value is returned instead of a 10-items array.
let a = [];
$.each(IDs, function(index, value) {
let au = $('#' + value + '.comment .user-name').text();
let av = $('#' + value + '.comment .profile-pic').attr('src');
let l = $('#' + value + '.comment .likes-count').text();
let arr = [value, au, av, l];
a.push = (arr);
});
console.log(a);
Output in console:
[push: Array(4)]
push: (4) ["99", "John Baker", "template/images/avatars/fav3.svg", "20"]
length: 0
__proto__: Array(0)
What am I doing wrong?
a.push = (arr);???