Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Specify when encode arg matters

...

The operator is most often used to guard against null values.

encode()

The encode() operator returns a string containing the JSON representation of the data structure to which it is applied. For example:

a = {"a" : 10, "b" : [1, 3, "hello"]};
b = a.encode() // b = "{'a' : 10, 'b' : [1, 3, 'hello']}";

The encode() operator takes an optional positive integer argument specifying that the object should be pretty printed (if it contains or is a map or array) with newlines and indents with that number of spaces.

isnull()

The isnull() operator returns true of the object is null (undefined) and false otherwise.

...