CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
initial.js23 linesDownload Raw Back to lodash
1var baseSlice = require('./_baseSlice');2 3/**4 * Gets all but the last element of `array`.5 *6 * @static7 * @memberOf _8 * @since 0.1.09 * @category Array10 * @param {Array} array The array to query.11 * @returns {Array} Returns the slice of `array`.12 * @example13 *14 * _.initial([1, 2, 3]);15 * // => [1, 2]16 */17function initial(array) {18  var length = array == null ? 0 : array.length;19  return length ? baseSlice(array, 0, -1) : [];20}21 22module.exports = initial;23 
basant307/AI_Governance_Project · CoolFace