You need to initialize your acceptedApplicants
and rejectedApplicants
arrays
There should be
acceptedApplicants = [];
rejectedApplicants= [];
somewhere above in the code. Like Peter said, if this is in a function make sure you var those variables.