IsLambda
IsLambda( value )
Description
The IsLambda
function returns true
only if value
is a
Lambda
function, otherwise it returns false
.
Examples
The following query uses Map
to iterate over an array of all of
the types of values that can be tested by a type-check function, passing
each item into a Lambda
function that returns an object, which
contains the value and the result of calling IsLambda
with that value:
[
{ value: [ 'array' ], IsLambda: false },
{ value: true, IsLambda: false },
{ value: false, IsLambda: false },
{ value: { '0': 1, '1': 2, '2': 3, '3': 4 }, IsLambda: false },
{ value: [ 1, 2, 3, 4 ], IsLambda: false },
{ value: Collection("Letters"), IsLambda: false },
{ value: Ref(Credentials(), "302043979982045696"), IsLambda: false },
{ value: Database("child_db"), IsLambda: false },
{ value: Date("2019-11-12"), IsLambda: false },
{ value: Ref(Collection("Letters"), "123"), IsLambda: false },
{ value: 10.1, IsLambda: false },
{ value: Function("double"), IsLambda: false },
{ value: Index("letters"), IsLambda: false },
{ value: 10, IsLambda: false },
{ value: Ref(Keys(), "1"), IsLambda: false },
{ value: Query(Lambda("x", Var("x"))), IsLambda: true },
{ value: null, IsLambda: false },
{ value: { x: 10 }, IsLambda: false },
{ value: Role("employees"), IsLambda: false },
{ value: Match(Index("letters")), IsLambda: false },
{ value: 'ten', IsLambda: false },
{ value: '10', IsLambda: false },
{ value: Time("2020-07-06T12:34:56.789Z"), IsLambda: false },
{ value: Ref(Tokens(), "1"), IsLambda: false }
]
This query operates on a pre-existing schema, which is not provided here. Also, the query is executed via a client connection, that uses a secret
acquired by calling the |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!