Double loop with map() function in Google Earth Engine
In Google Earth Engine Developer's Guide , there is a recommendation to avoid for() loops. They recommend to use map() function as this example: // to avoid var clientList = []; for(var i = 0; i < 8; i++) { clientList.push(i + 1); } print(clientList); // to use var serverList = ee.List.sequence(0, 7); serverList = serverList.map(function(n) { return ee.Number(n).add(1); }); print(serverList); I'm trying to select MODIS scenes from each month/year prior to compute VCI. So, the approach I'd take is with a double loop: modis = ee.ImageCollection("MODIS/MYD13A1"); var modis_list = []; for(var i =