var obj = {
arr: []
}
var item = {}
$('table tr').each(function(i, elem){
item.title = $(this).find('td .title').text();
item.descr = $(this).find('td .descr').text();
console.log(item); //выводит все строки в таблице в разными title и descr
obj.arr.push(item); // добавляю эти строки в массив
})
console.log(menu); // в массиве наблюдаю n-элементов и все с title и descr последней строки в таблице
Почему так?
