I'm trying to create an array in jquery. I need this array to have multiple other arrays in them.
My code now:
var arr = [];
$('.thumb').each(function(){
arr.push($(this).attr('data-storename'),$(this).attr('data-grid-item-id'));
});
This gives me just 1 array with all the data-storename's and data-grid-item-id's in it.
I want my array to look like :
0 [
0 => data-storename : (someinfo)
1 => data-grid-item-id : (someinfo)
]
1 [
0 => data-storename : (someinfo)
1 => data-grid-item-id : (someinfo)
]
and so on.
All my attempts end up being one single array, but just nested inside another array. Any help?
arr.push([..., ...]);in theeach().Array.from($('.thumb'), function (el) { return [..., ...] })