[jQuery] Check value when adding to array

[jQuery] Check value when adding to array


I have input values that I am adding to a array. I would like to be
able to check if any of them end in _test and if so, I need to set a
specific value. Is there any, in an if statement, to check if an
attribute of one of the input fields ends with _test?
main_form.find('input').each(function() {
arr_current_item2.push($(this).attr('name') + '=' + $(this).val());
});// End each