code: function median(x) {
          // The median of an empty list is null
          if (x.length === 0) return null;
  
          // Sorting the array makes it easy to find the center, but
          // use `.slice()` to ensure the original array `x` is not modified
          var sorted = x.slice().sort(function (a, b) { return a - b; });
  
          // If the length of the list is odd, it's the central number
          if (sorted.length % 2 === 1) {
              return sorted[(sorted.length - 1) / 2];
          // Otherwise, the median is the average of the two numbers
          // at the center of the list
          } else {
              var a = sorted[(sorted.length / 2) - 1];
              var b = sorted[(sorted.length / 2)];
              return (a + b) / 2;
          }
      }
docs: # [median](http://en.wikipedia.org/wiki/Median)  The middle number of a list. This is often a good indicator of 'the middle' when there are outliers that skew the `mean()` value.