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