I have implemented the answer of Noel Gorelick to the question: Earth Engine get dates from imageCollection It is the following code:
var dates = s1_collection_f
.map(function(image) {
return ee.Feature(null, {'date': image.date().format('YYYY-MM-dd')})
})
.distinct('date')
.aggregate_array('date')
It successfully returned a list of dates in the format 'YYYY-MM-dd', but I cannot read that list. I need to get every single date to be joined in the layers names. It seems to be weird, but I can't loop through the elements of the list. I have tried the following:
The console returns for each element of the list:
for (var index in dates) { print(dates[index]); }
Nothing is returned:
for (var i=0; i< dates.length(); i++) { print(dates[i]); }
How can I loop through the list and get each date?