On this page
Class Map
Hierarchy
- Map
Index
Constructors
constructor
-
Creates a new Sass map.
Parameters
length: number
The number of (initially undefined) key/value pairs in the map.
Returns Map
Methods
getKey
-
Returns the key in the key/value pair at
index
.Parameters
index: number
A (0-based) index of a key/value pair in this map.
Returns LegacyValue
getLength
-
Returns the number of key/value pairs in this map.
Returns number
getValue
-
Returns the value in the key/value pair at
index
.Parameters
index: number
A (0-based) index of a key/value pair in this map.
Returns LegacyValue
setKey
-
Sets the value in the key/value pair at
index
tovalue
.Parameters
index: number
A (0-based) index of a key/value pair in this map.
key: LegacyValue
Returns void
setValue
-
Sets the value in the key/value pair at
index
tovalue
.Parameters
index: number
A (0-based) index of a key/value pair in this map.
value: LegacyValue
Returns void
© 2006–2022 the Sass team, and numerous contributors
Licensed under the MIT License.
https://sass-lang.com/documentation/js-api/classes/types.Map
Sass's map type.
⚠️ Heads up!
This map type is represented as a list of key-value pairs rather than a mapping from keys to values. The only way to find the value associated with a given key is to iterate through the map checking for that key. Maps created through this API are still forbidden from having duplicate keys.