### Classes

#### TypedDict
`p5compat.module:TypedDict~TypedDict`

### Methods

#### inner clear()
`jsboot/p5util.js`, `line 1354`

  Removes all previously stored key-value pairs from the Dictionary.

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        print(myDictionary.hasKey('p5')); // prints 'true'
        myDictionary.clear();
        print(myDictionary.hasKey('p5')); // prints 'false'
      }

#### inner create(key, value)
`jsboot/p5util.js`, `line 1326`

  Creates a new key-value pair in the Dictionary.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | Number | String |
  `value` | Number | String |

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        myDictionary.create('happy', 'coding');
        myDictionary.print();
        // above logs "key: p5 - value: js, key: happy - value: coding" to console
      }

#### inner get(the) → {Number|String}
`jsboot/p5util.js`, `line 1270`

  Returns the value stored at the given key.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `the` | Number | String | key you want to access

  ##### Returns:

  Number | String - the value stored at that key

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        let myValue = myDictionary.get('p5');
        print(myValue === 'js'); // logs true to console
      }

#### inner hasKey(key) → {Boolean}
`jsboot/p5util.js`, `line 1252`

  Returns true if the given key exists in the Dictionary, otherwise returns false.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | Number | String | that you want to look up

  ##### Returns:

  Boolean - whether that key exists in Dictionary

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        print(myDictionary.hasKey('p5')); // logs true to console
      }

#### inner print()
`jsboot/p5util.js`, `line 1395`

  Logs the set of items currently stored in the Dictionary to the console.

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        myDictionary.create('happy', 'coding');
        myDictionary.print();
        // above logs "key: p5 - value: js, key: happy - value: coding" to console
      }

#### inner remove(key)
`jsboot/p5util.js`, `line 1370`

  Removes the key-value pair stored at the given key from the Dictionary.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | Number | String | for the pair to remove

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        myDictionary.create('happy', 'coding');
        myDictionary.print();
        // above logs "key: p5 - value: js, key: happy - value: coding" to console
        myDictionary.remove('p5');
        myDictionary.print();
        // above logs "key: happy value: coding" to console
      }

#### inner saveJSON()
`jsboot/p5util.js`, `line 1414`

  Converts the Dictionary into a JSON file for local download.

  ##### Example

      function setup() {
        createCanvas(100, 100);
        background(200);
        text('click here to save', 10, 10, 70, 80);
      }

      function mousePressed() {
        if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {
          createStringDict({
            john: 1940,
            paul: 1942,
            george: 1943,
            ringo: 1940
          }).saveJSON('beatles');
        }
      }

#### inner set(key, value)
`jsboot/p5util.js`, `line 1292`

  Updates the value associated with the given key in case it already exists in the Dictionary. Otherwise a new key-value pair is added.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | Number | String |
  `value` | Number | String |

  ##### Example

      function setup() {
        let myDictionary = createStringDict('p5', 'js');
        myDictionary.set('p5', 'JS');
        myDictionary.print(); // logs "key: p5 - value: JS" to console
      }

#### inner size() → {Integer}
`jsboot/p5util.js`, `line 1234`

  Returns the number of key-value pairs currently stored in the Dictionary.

  ##### Returns:

  Integer - the number of key-value pairs in the Dictionary

  ##### Example

      function setup() {
        let myDictionary = createNumberDict(1, 10);
        myDictionary.create(2, 20);
        myDictionary.create(3, 30);
        print(myDictionary.size()); // logs 3 to the console
      }