[JS] Compare two array then return array of items list difference

Post Reply
tthlan
Quản trị viên
Posts: 76
Joined: Tue Aug 23, 2016 8:13 am

[JS] Compare two array then return array of items list difference

Post by tthlan »

[JS] Compare two array then return array of items list difference

Code: Select all

###########################

var diff_list = renderTimetableUpdate(rsv_history_list, oldRsv_render_list);

###########################

/**
 * Return list item differnce between two list Reservation
 * @param {*} p_new_list as rsv_history_list
 * @param {*} p_old_list as rsv_history_render
 */
function renderTimetableUpdate(p_new_list, p_old_list){
	// function compare of array
	var rsv_update_list = p_new_list.filter(comparer(p_old_list));
	return rsv_update_list;
}

#############################
Post Reply