Skip to content

JSON Objects

The jsn values represent JSON objects with native support for nested properties, lists, and utility methods.

jsn persona = {
nombre: "Ana",
edad: 28,
activo: verdadero
}
texto nombre = persona.nombre
numero peso = persona.datos_personales.peso
texto nombre = persona["nombre"]
texto especial = datos["clave con espacios"]
MethodDescriptionReturns
contiene_clave(clave)Checks if property existslog
MethodDescriptionReturns
claves()List of first-level keyslista<texto>
valores()List of first-level valueslista
MethodDescription
establecer(clave, valor)Assign or create a property
eliminar(clave)Delete a property and return its value
MethodDescription
fusionar(otro_json)Combine properties (existing ones are overwritten)
MethodDescription
texto()Serialize to compact JSON
texto_formateado()Serialize with readable indentation
texto json_texto = '{"nombre":"Ana","edad":25}'
jsn var persona = json_texto.jsn()
  1. Declare with var JSON objects you need to modify.
  2. Use contiene_clave() before accessing properties that might not exist.
  3. Validate external JSON with intentar/capturar when parsing strings.
  4. Use texto_formateado() for debugging and readable logs.