indexOf in google script
问题 I'm trying to use findIndex() on a object in google script but it does not work. Here is a exemple: function myFunction() { var searchingJohn = "John"; var DATA = {namesList: []}; DATA.namesList.push({name: "John", otherDataForThisName: []}); var result = DATA.namesList.findIndex(function (element) {return element.name == this;}, searchingJohn); return result; } this work well in a javascript consol but google script return me a "TypeError: Fonction findIndex not found in object....." 回答1: