p5.js TypedDict get() Method
The get() method of p5.TypedDict in p5.js is used to return the value at the given key of the dictionary. The method returns undefined if the key does not exist in the dictionary. A key-value pair is a set of two values that are mapped to each other. These values can be accessed by querying this dictionary using the key portion of the pair. A typed dictionary can store multiple key-value pairs that can be accessed using the methods of the dictionary.
get( key )
Parameters: This method accepts a single parameter as shown above and discussed below:
- key: This is a number or string that denotes the key that has to be added to the dictionary.
Return Value: This method returns a number or string that denotes the value stored at the given key.
The example below illustrates the get() method in p5.js:
Online editor: https://editor.p5js.org/
Environment Setup: https://www.geeksforgeeks.org/p5-js-soundfile-object-installation-and-methods/