The print() on the Google Earth Engine cloud editor just processes the information and prints a value in the console. What's the equivalent on a standalone application JavaScript/HTML application using the google earth api?
I've tried using console.log(JSON.stingify()) but all that I obtain is a description of the object.
The code I'm trying to compute is:
var chirps = ee.ImageCollection('UCSB-CHG/CHIRPS/PENTAD');
var year = 2017;
var startDate = ee.Date.fromYMD(year, 1, 1);
var endDate = startDate.advance(1, 'year');
var filtered = chirps
.filter(ee.Filter.date(startDate, endDate));
var total = filtered.reduce(ee.Reducer.sum());
var bangalore = ee.FeatureCollection("users/ujavalgandhi/public/bangalore_boundary");
var stats = total.reduceRegion({
reducer: ee.Reducer.mean(),
geometry: bangalore,
scale: 5000,
})
console.log(stats);
console.log(JSON.stringify(stats.get('precipitation_sum'))); // 1336.52 mm
Thanks