title: Comparing every element of two lists of dictionaries
body: <p>in Google Earth Engine I have two list of dictionaries.
  I would like to have a new list of dictionaries containing {date: ..., prec_mm: .... , moisture: ....}, when moisture value is available. Else I want a null value.</p>
  <p>I don't know how to check every element of the list (regardless the index of the elements) and how to write the entire list at the end.</p>
  <pre><code>var prec = [                                                                       
    {data:20150801, prec_mm:11.2},                                                 
    {data:20150802, prec_mm:0},   
    {data:20150803, prec_mm:0},   
    {data:20150804, prec_mm:0},   
    {data:20150805, prec_mm:0},   
    {data:20150806, prec_mm:0},   
    {data:20150807, prec_mm:0},   
    {data:20150808, prec_mm:0},   
    {data:20150809, prec_mm:0},   
    {data:20150810, prec_mm:0},
    {data:20150811, prec_mm:2.2},
    {data:20150812, prec_mm:0},
    {data:20150813, prec_mm:0},
    {data:20150814, prec_mm:0.6},
    {data:20150815, prec_mm:11.2},
    {data:20150816, prec_mm:3.4},
    {data:20150817, prec_mm:0},
    ];
    
    
  var moisture = [
    {data:20150801, moisture:0.1},                                                 
    {data:20150802, moisture:0},  
    {data:20150803, moisture:0.2},
    {data:20150804, moisture:null},
    {data:20150810, moisture:0.05},   
    {data:20150816, moisture:0.3},
    {data:20150817, moisure:null}
  ]
  
  for(var i=0; i&lt;prec.length; i++){
    var final = []
    if (prec[i].data == moisture[i].data) {
      final.push(prec[i].data, prec[i].prec_mm, moisture[i].moisture) 
      print(final) 
        }
    else if (prec[i].data != moisture[i].data) {
      final.push(prec[i].data, prec[i].prec_mm, null)
      print(final)} 
  };
  
  </code></pre>
  <p>Thanks in advance</p>