I am attempting to determine whether a passed value to the function addToCalendar (sport) includes the String "soccer" by using the code below:
function addToCalendar(sport, date, time){
var sportName = String(sport);
Logger.log(sportName.includes("Soccer"));
}
However, I am getting this error: TypeError: Cannot find function includes in object Soccer: Girls JV. (line 77, file "Code") how would I fix this?
sportName.indexOf('Soccer'), which returns -1 if the substring is not contained, or the correct index if otherwise