Sass map-has-key() Function

Last Updated:

Sass map-has-key() Function

The map-has-key() function returns whether a map contains a value associated with a key.

Example

SASS TO CSS CONVERTER
$font-weights: ("regular": 400, "medium": 500, "bold": 700); @debug map-has-key($font-weights, "regular"); // true @debug map-has-key($font-weights, "bolder"); // false

Syntax

map-has-key($map, $key)

Parameter Value

ValueTypeExplanation
$map Required Specifies an array.
$key Required Specifies a key in an array.

Return Value

ValueExplanation
bool Returns whether $map contains a value associated with $key.

Share this Page

Meet the Author