Skip to content

toObject

toObject(value) → object · Type

Try to convert a value to an object. Arrays of pairs become objects; objects pass through.

  • value (required): value to convert
utlx
toObject([["name", "Alice"], ["age", 30]])  // {"name": "Alice", "age": 30}

Released under AGPL-3.0.