0

I want to create a simple function that returns a boolean value when the word "website" appears in a specific cell. When I run the debugger, matches returns undefined.

function myFunction() {
  var url = ss.getRange(8,1).getValue().toString(); 
  var matches = url.includes("website");
  return matches; 
}

Why doesn't my function return a boolean value?

0

1 Answer 1

0

Your function doesn't returns a boolean because Google Apps Script doesn't support String.prototype.includes() in the same way that it doesn't support several of the additions introduced in ECMAScript 2015

Related

Reference

2

Not the answer you're looking for? Browse other questions tagged or ask your own question.