Version 1
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / nthArg.js
diff --git a/node_modules/grunt-legacy-log-utils/node_modules/lodash/nthArg.js b/node_modules/grunt-legacy-log-utils/node_modules/lodash/nthArg.js
new file mode 100644 (file)
index 0000000..bf95dd0
--- /dev/null
@@ -0,0 +1,25 @@
+var toInteger = require('./toInteger');
+
+/**
+ * Creates a function that returns its nth argument.
+ *
+ * @static
+ * @memberOf _
+ * @category Util
+ * @param {number} [n=0] The index of the argument to return.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var func = _.nthArg(1);
+ *
+ * func('a', 'b', 'c');
+ * // => 'b'
+ */
+function nthArg(n) {
+  n = toInteger(n);
+  return function() {
+    return arguments[n];
+  };
+}
+
+module.exports = nthArg;