Skip to main content
Module

x/lodash_es/mod.ts>constant

lodash for deno use
Latest
function constant
import { constant } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Creates a function that returns value.

Examples

var objects = _.times(2, _.constant({ 'a': 1 }));

console.log(objects); // => [{ 'a': 1 }, { 'a': 1 }]

console.log(objects[0] === objects[1]); // => true

Parameters

value

The value to return from the new function.