Page 1 of 1

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

Posted: Sun Mar 04, 2018 4:14 pm
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;
}

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