I have a javascript object that looks like below:
selectedUsers.push({
qid : qid,
first : $(this).data('emp_first'),
last : $(this).data('emp_last'),
department : $(this).data('emp_dept'),
ntid : $(this).data('emp_ntid'),
supFirst : $(this).data('emp_sup_first'),
supLast : $(this).data('emp_sup_last'),
supNTID : $(this).data('emp_sup_ntid'),
title : ($(this).data('emp_title') ? $(this).data('emp_title') : 'N/A'),
location: ($(this).data('emp_location') ? $(this).data('emp_location') : 'N/A'),
skillset : ($(this).data('emp_skillset') ? $(this).data('emp_skillset') : 'N/A'),
departmentID : $(this).data('emp_dept_id'),
titleID : $(this).data('emp_title_id'),
regionID : $(this).data('emp_region_id'),
instances : ($(this).data('emp_instances') != '' ? $(this).data('emp_instances').split(',') : '')
});
When an action is taken on my page, I need to update the value of departmentID in this object.
However, I need to do this for a specific result in the object.
So first I need to find the result where selectedUsers.qid = 'bob123' and then set the value for his departmentID manually.
What would be the best way to search for this result in order to edit the value for the specific key?