Builder (key & value)

[data/dictionary/Builder (key & value)]


Builds a dictionary based on an array of keys and a single value for all items. Example:

  1. [ "first", "third", "fifth" ]@0 received via keys

  2. 1@0 received via value

  3. dict sends { "first": 1, "third": 1, "fifth": 1 }@0

More: https://github.com/Cranq-io/cranq-tutorials/tree/main/reference/2_constructing_data/2_2_builders


Keywords: dictionary, dict, build, new, create

Input ports

  • key: string

    Receives the keys to construct the dictionary from. Example: ["first","third","fifth"]

  • value: any

    Receives the value to assign to all items. Example: 1

Output ports

  • dict: {string: any}

    Sends the resulting dictionary. Example: { "first": 1, "third": 1, "fifth": 1 }

Last updated