Hi
I am trying to loop and push those values into an array but the problem is while looping and in the 2nd loop it is considering first loop values and storing in an array.
var TutorcousePush = new Array();
var TutorcourseDetails = new Object();
var $tblrows = $("#tbl_TutorcoursList tbody tr");
$tblrows.each(function (index,course) {
var $tblrow = $(this);
TutorcourseDetails.SubjectId = $tblrow.find("[name=subId]").text();
TutorcourseDetails.SchoolLevelId = $tblrow.find("[name=sclevlId]").text();
TutorcourseDetails.selectedCourseIDs = $tblrow.find("[name=selectdcoursId]").text();
TutorcousePush.push(TutorcourseDetails);
});
Ultimately its is storing the same values in two arrays like below given example
array[0]:
{
subjectId:1
schoollevelid :1
selectedcourseIds:1765,1567,1678 }
array[1]:
{
subjectId:1
schoollevelid :1
selectedcourseIds:1765,1567,1678 }