Concatenating strings in Google Apps Script
How do I get both values represented by i and j into the getSheetByName function? Disclaimer: I am brand new at coding and am probably asking the wrong questions. My goal is to create a simple code that will delete sheets automatically by looping through the sheet names: Week 1, Week 2, etc. Here's my code so far: function myFunction() { var sheet = SpreadsheetApp.getActiveSpreadsheet() var i = "Week " var j = 32 var mysheet = sheet.getSheetByName(i&j) sheet.deleteSheet(mysheet) } In your code you have written i&j that's not the syntax to concat in Google apps script. Instead you can simply