Version 1
[yaffs-website] / node_modules / grunt-legacy-log / node_modules / lodash / array / last.js
diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/array/last.js b/node_modules/grunt-legacy-log/node_modules/lodash/array/last.js
new file mode 100644 (file)
index 0000000..299af31
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ * Gets the last element of `array`.
+ *
+ * @static
+ * @memberOf _
+ * @category Array
+ * @param {Array} array The array to query.
+ * @returns {*} Returns the last element of `array`.
+ * @example
+ *
+ * _.last([1, 2, 3]);
+ * // => 3
+ */
+function last(array) {
+  var length = array ? array.length : 0;
+  return length ? array[length - 1] : undefined;
+}
+
+module.exports = last;