toLabelAndValue (source code)
- Curried: false
- Failsafe status: failsafe by default
The toLabelAndValue
function takes a string as an argument and returns an
object with keys "label" and "value." It is often used to transform a string
into an object with specific key-value pairs.
string
: A string that needs to be converted to an object.
toLabelAndValue("test");
// output: {label: "test", value: "test"}