code: function(w) {
      if(w.length === 0) { return {}; } // ... ;s
      var maxv = w[0];
      var minv = w[0];
      var maxi = 0;
      var mini = 0;
      var n = w.length;
      for(var i=1;i<n;i++) {
        if(w[i] > maxv) { maxv = w[i]; maxi = i; } 
        if(w[i] < minv) { minv = w[i]; mini = i; } 
      }
      return {maxi: maxi, maxv: maxv, mini: mini, minv: minv, dv:maxv-minv};
    }
docs: return max and min of a given non-empty array.