Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use double quotes in encode example

...

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.

...