I have two variables, one holds a hard coded date and the other has an array with a single value (for testing) . the value in the array matches the hard coded value yet I get a return of -1(no match).
var cur_date = new Date('7/31/2018') ;
var last_row_cur = sales_sheet.getRange(1,1,20,10).getCell(index+1,10).getValue();
var date_array = sales_sheet.getRange(index,9,last_row_cur,1).getValues()[1];
var date_index = date_array.map(function(e) {return e[0]}).indexOf(cur_date);
the log results: Cur_date = Tue Jul 31 00:00:00 GMT-05:00 2018
var_date_array = [Tue Jul 31 00:00:00 GMT-05:00 2018]
var_date_index = -1
I was hoping var_date_index would return 0 as is the only result in the array and the dates match. I am guessing it has something to do with the [] but I am new to this so not sure. TIA