To use find, you can connect the library Golyfils or use the Polyfill.
Last active
May 24, 2018 13:36
-
-
Save oshliaer/68419878281e30f590b02b4627d23b43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function example(){ | |
| var gid = '697110211'; | |
| var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
| Logger.log(getSheetByGid(spreadsheet, gid)); | |
| } | |
| function getSheetByGid(spreadsheet, gid){ | |
| return spreadsheet.getSheets().find(findByGid_, gid); | |
| } | |
| function findByGid_(sheet){ | |
| return this == sheet.getSheetId(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment