I have a button with an id of #file_add_btn. When clicking this button a file input is appended to my form:
<input type="file" class="btn_browse" name="file_uploads[]">
I create an array to store the filenames for checking whether the selected file is already selected previously by any previous file inputs.
When I try to alert the count of array filename_array it is giving me an error in the console:
TypeError: filename_array.count is not a function
var filename_array = [];
$(document).on('change', '.btn_browse', function() {
filename_array.push($(this).val().split('\\').pop());
alert(filename_array.count($(this).val().split('\\').pop()));
});