# ifpresent

    .ifpresent value:{Dynamic} mapping:{Lambda} -> Any

Content copied to clipboard

Maps value to the result of mapping. This function is usually inlined:

    .name::ifpresent {x: .x::uppercase}::otherwise {unnamed}

Content copied to clipboard

A constant result is also valid:

    .name::ifpresent {I have a name}::otherwise {I'm unnamed}

Content copied to clipboard

#### Return

the result of mapping executed on value if value is not none, none otherwise

#### Parameters

value

value to check

mapping

lambda to execute if value is not none. It should accept one argument, which is value, and return a value.

#### See also

isNone

#### Chaining

This function is designed to be chained with other function calls:

    Dynamic::ifpresent mapping:{Lambda} -> Any

Content copied to clipboard

#### Wiki page

none