Version 1
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / mean.js
diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/mean.js b/node_modules/grunt-legacy-util/node_modules/lodash/mean.js
new file mode 100644 (file)
index 0000000..739dc41
--- /dev/null
@@ -0,0 +1,20 @@
+var sum = require('./sum');
+
+/**
+ * Computes the mean of the values in `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Math
+ * @param {Array} array The array to iterate over.
+ * @returns {number} Returns the mean.
+ * @example
+ *
+ * _.mean([4, 2, 8, 6]);
+ * // => 5
+ */
+function mean(array) {
+  return sum(array) / (array ? array.length : 0);
+}
+
+module.exports = mean;