1-liners
Version:
Useful oneliners and shorthand functions
24 lines (20 loc) • 334 B
JavaScript
/**
* @module 1-liners/nth
*
* @description
*
* Returns the nth item of an array.
*
* @example
*
* const nth = require('1-liners/nth');
*
* nth(1, [1, 2, 3]); // => 2
*
*/
;
exports.__esModule = true;
exports["default"] = function (n, arr) {
return arr[n];
};
module.exports = exports["default"];