Skip to content

The JSON Standard Library

C272 edited this page Aug 29, 2019 · 4 revisions

Facilitates the serializing and deserializing of Algo to JSON (JavaScript Object Notation).


json.make(val)

Serializes an Algo object or list to JSON, providing none of the object members are unsupported types. The list of supported types is as follows:

  • Object
  • List
  • String
  • Integer
  • Float
  • Rational
  • Boolean
  • Null

Parameters:

Name Description
val The object or list to serialize to JSON.

Usage:

let obj = object 
{
    let x = 3;
    let y = "example";
    let z = [1, 2];
}

let someJSON = json.make(obj); //{ x: 3, y:"example", z:[1, 2]}

Standard Library Documentation:

Clone this wiki locally