aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js')
-rw-r--r--deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js b/deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js
new file mode 100644
index 0000000000..299af3146c
--- /dev/null
+++ b/deps/npm/node_modules/cli-table2/node_modules/lodash/array/last.js
@@ -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;