CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
constant.js27 linesDownload Raw Back to lodash-es
1/**2 * Creates a function that returns `value`.3 *4 * @static5 * @memberOf _6 * @since 2.4.07 * @category Util8 * @param {*} value The value to return from the new function.9 * @returns {Function} Returns the new constant function.10 * @example11 *12 * var objects = _.times(2, _.constant({ 'a': 1 }));13 *14 * console.log(objects);15 * // => [{ 'a': 1 }, { 'a': 1 }]16 *17 * console.log(objects[0] === objects[1]);18 * // => true19 */20function constant(value) {21  return function() {22    return value;23  };24}25 26export default constant;27 
basant307/AI_Governance_Project · CoolFace