@newdash/newdash
Version:
javascript/typescript utility library
32 lines (31 loc) • 692 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.first = void 0;
const head_1 = __importDefault(require("./head"));
/**
* Gets the first element of `array`.
*
* @since 5.5.0
* @category Array
* @param array The array to query.
* @returns Returns the first element of `array`.
* @see [[head]]
* @example
*
* ```js
* first([1, 2, 3]);
* // => 1
*
* first([]);
* // => undefined
* ```
*/
function first(array) {
return (0, head_1.default)(array);
}
exports.first = first;
;
exports.default = first;