Very useful, Tyler, thanks! After looking at the documentation, I was able to apply a second mask to exclude water. So this shows snow pixels (NDSI < 0.4) over land as white – everything else is transparent, which is what I was going for. Looks great on top of the satellite imagery. I used the Hansen dataset to identify land pixels, based on the example in Google's tutorial.
//Select the datamask band from the Hansen data
var datamask = Hansen.select('datamask');
// Create a binary mask. For this band, 0=No Data, 1=Land, and 2=Water
var HansenMask = datamask.eq(1);
var winter = NDSI.filter(ee.Filter.calendarRange(1999,2018,'year')).filter(ee.Filter.calendarRange(6,8,'month'));
var medianWinter = winter.median();
var medianWinterMask = medianWinter.gt(0.4);
var doubleMask = medianWinterMask.updateMask(HansenMask);
Map.addLayer(doubleMask.updateMask(medianWinterMask));
This gets the job done, but there other more elegant ways of masking water, snow, and clouds – notably Fmask – here are two great tutorials with useful examples:
https://medium.com/upstream/find-water-and-remove-clouds-with-fmask-on-google-earth-engine-261c090cb62d
https://www.researchgate.net/publication/302589628_Generating_a_cloud-free_homogeneous_Landsat-8_mosaic_of_Switzerland_using_Google_Earth_Engine