javascript - getDisplayValues() not writing as strings -
i'm trying write script pulls values column in spreadsheet array using getdisplayvalues() , compare different elements each other. when comparing 2 elements evaluate unequal, when aren't. seems because elements objects, though getdisplayvalues() should return strings.
var ids = sheet.getrange(row,col,sheetheight).getdisplayvalues(); //comparing identical elements logger.log(ids[4] == ids[5]); logger.log(typeof(ids[4])); logger.log(typeof(ids[5]));
logs
false object object
how can evaluate correctly?
getrange method return range, bi-dimensionnal array, if have single column. must compare :
var ids = sheet.getrange(row,col,sheetheight).getdisplayvalues(); //comparing identical elements logger.log(ids[4][0] == ids[5][0]); logger.log(typeof(ids[4][0])); logger.log(typeof(ids[5][0]));
Comments
Post a Comment