# Map

##

{% tabs %}
{% tab title="set" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
}

func() // Expected: Promise<void>
```

{% endcode %}
{% endtab %}

{% tab title="get" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
    
    let getMap = testMap.get('testKey')
    
    console.log(getMap)
}

func() // Expected: testValue
```

{% endcode %}
{% endtab %}

{% tab title="firsKey" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
    
    let mapKey = testMap.firstKey()
    
    console.log(mapKey)
}

func() // Expected: testKey
```

{% endcode %}
{% endtab %}

{% tab title="firstValue" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
    
    let mapValue = testMap.firstValue()
    
    console.log(mapValue)
}

func() // Expected: testValue
```

{% endcode %}
{% endtab %}

{% tab title="values" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
    testMap.set('testKeyTwo', 'testValueTwo')
    
    let mapValues = testMap.values()
    
    console.log(mapValues)
}

func() // Expected: All "testMap" values
```

{% endcode %}
{% endtab %}

{% tab title="write" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map()
    
    testMap.set('testKey', 'testValue')
    testMap.set('testKeyTwo', 'testValueTwo')
    
    testMap.write(require('path').resolve(__dirname, 'path/to/json.json'))
}

func() // Expected: Write configured values in json - Promise
```

{% endcode %}
{% endtab %}

{% tab title="constructor - load" %}
{% code title="map.js" %}

```javascript
import { Map } from 'the-simplifier'

let func = () => {
    let testMap = new Map({ load: require('path').resolve(__dirname, 'path/to/json.json') })
    
    let jsonValue = testMap.get('Message')
    
    console.log(jsonValue)
}

func() // Expected: Hello
```

{% endcode %}
{% endtab %}
{% endtabs %}
