79521092

Date: 2025-03-19 18:36:03
Score: 0.5
Natty:
Report link

You can use the Map module from Core.

let t: Map.t<string, string> = Map.make()

let add = (key: string, value: string) => {
  t->Map.set(key, value)
}

let x = add("foo", "bar")

Console.log(t->Map.get("foo")) // => "bar"

https://rescript-lang.org/docs/manual/v11.0.0/api/core/map#value-set

Reasons:
  • Whitelisted phrase (-1.5): You can use
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Josh Derocher-Vlk